Closed
Bug 372565
Opened 18 years ago
Closed 18 years ago
"Assertion failure: top < ss->printer->script->depth" decompiling a function where a const identifier is used as a for-loop variable
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: mrbkap)
References
Details
(4 keywords)
Attachments
(1 file, 1 obsolete file)
9.07 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
js> function() { for each(x in y) { } const x; }
Assertion failure: top < ss->printer->script->depth, at jsopcode.c:845
Flags: blocking1.9?
Assignee | ||
Comment 1•18 years ago
|
||
Because we rely on the JSOP_FOR* to call the current iterator's next method, the current code, which emits a JSOP_GETVAR in place of the JSOP_FORVAR breaks not only decompilation, but actually goes into an infinite loop. Here's a testcase:
(function() { const x = 3; for each(x in {1:1,2:2}) { print(x); } })()
My proposed solution is to add a JSOP_FORCONST which knows to not actually update the slot given, but does call the iterator's next method. The testcase correctly decompiles and runs with this patch.
Comment 2•18 years ago
|
||
How about eliminating the useless JSOP_STARTITER while you are at it, and reclaiming that bytecode? (Be careful to set pos = blockpos + 1; in the JSOP_ARRAYPUSH case of Decompile.)
/be
Blocks: js1.7src
Assignee | ||
Comment 3•18 years ago
|
||
Attachment #258148 -
Attachment is obsolete: true
Attachment #258152 -
Flags: review?(brendan)
Attachment #258148 -
Flags: review?(brendan)
Comment 4•18 years ago
|
||
Comment on attachment 258152 [details] [diff] [review]
With that
Great, thanks!
/be
Attachment #258152 -
Flags: review?(brendan) → review+
Assignee | ||
Comment 5•18 years ago
|
||
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 6•18 years ago
|
||
/cvsroot/mozilla/js/tests/js1_6/Regress/regress-372565.js,v <-- regress-372565.js
initial revision: 1.1
Flags: in-testsuite+
Comment 8•16 years ago
|
||
This bug also exists on the MOZILLA_1_8_BRANCH and I backported the patch above in bug 437288.
You need to log in
before you can comment on or make changes to this bug.
Description
•