Closed
Bug 164697
Opened 23 years ago
Closed 23 years ago
RegExp object created by compiler may be wrong for execution contexts
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.2alpha
People
(Reporter: brendan, Assigned: brendan)
References
Details
(Keywords: js1.5)
Attachments
(1 file, 1 obsolete file)
|
9.58 KB,
patch
|
rogerl
:
review+
shaver
:
superreview+
|
Details | Diff | Splinter Review |
The JS API lets you compile once, execute many times using different scope
chains ending in different global objects. Untrusted JS authors can mess up one
another via /hi/.__proto__, which refers to the compile-time global object's
RegExp.prototype. We need something akin to function object cloning to handle
this, without adding too much complexity to the trivial "evaluate" case where
"compile" and "execute" use the same global.
/be
| Assignee | ||
Comment 1•23 years ago
|
||
Taking.
/be
Status: NEW → ASSIGNED
Keywords: js1.5,
mozilla1.2
Priority: -- → P1
Target Milestone: --- → mozilla1.2alpha
| Assignee | ||
Comment 2•23 years ago
|
||
I'm still rebuilding my debug trunk mozilla build to test whether the new code
under JSOP_OBJECT's case in js_Interpret, to handle different compile- and
exec-time global objects, gets hit (it should, I think, due to Mozilla's XUL
brutal sharing). This patch passes the js/tests suite. Please tell me if it
worksforyou, or not.
/be
| Assignee | ||
Comment 3•23 years ago
|
||
Attachment #96776 -
Attachment is obsolete: true
| Assignee | ||
Comment 4•23 years ago
|
||
Anyone test this yet?
rogerl, shaver: your review is craved.
/be
Comment 5•23 years ago
|
||
Comment on attachment 96778 [details] [diff] [review]
oops, fp->objAtomMap is sparse, js_GC must null-test elements in it
r=rogerl
Attachment #96778 -
Flags: review+
Comment 6•23 years ago
|
||
Comment on attachment 96778 [details] [diff] [review]
oops, fp->objAtomMap is sparse, js_GC must null-test elements in it
sr=shaver
Attachment #96778 -
Flags: superreview+
Comment 7•23 years ago
|
||
The patch passes the JS testsuite on WinNT, in both the debug
and optimized JS shell. No test regressions were introduced -
| Assignee | ||
Comment 8•23 years ago
|
||
Fix is in the trunk. This'll need to land on the branch along with a bunch of
other fixes for 1.5 final.
/be
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 9•23 years ago
|
||
QA note: part of this fix has been backed out to fix bug 165201:
http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/js/src/jsinterp.c
Bug 165201 is being held open until the best possible solution can be
found. In this situation, let me go ahead and mark this bug Verified -
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Flags: testcase?
Comment 10•20 years ago
|
||
I'm not sure how to fully test this however I added
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-164697.js,v <-- regress-164697.js
initial revision: 1.1
to test Brendan's assertion that
* This same coupling between instance parent and constructor
* parent turns up elsewhere (see jsobj.c's FindConstructor,
* js_ConstructObject, and js_NewObject). It's fundamental.
for Objects, Functions, Arrays, Strings, Booleans, Numbers, Dates, RegExps and Errors. All pass except anonymous function expressions. I'll file new bug on that.
Flags: testcase? → testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•