Closed
Bug 351496
Opened 18 years ago
Closed 18 years ago
"let (y = 3)" in "case" expression decompiles as "let (3 = 3)"
Categories
(Core :: JavaScript Engine, defect, P2)
Tracking
()
VERIFIED
FIXED
mozilla1.8.1
People
(Reporter: jruderman, Assigned: brendan)
Details
(Keywords: testcase, verified1.8.1)
Attachments
(1 file, 1 obsolete file)
4.67 KB,
patch
|
mrbkap
:
review+
mtschrep
:
approval1.8.1+
|
Details | Diff | Splinter Review |
js> function() { switch(0) { case let(y = 3) 6: } }
function () {
switch (0) {
case let (3 = 3) 6:
default:;
}
}
Assignee | ||
Comment 1•18 years ago
|
||
Updated•18 years ago
|
Attachment #237276 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 2•18 years ago
|
||
Fixed on trunk.
/be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 3•18 years ago
|
||
Comment on attachment 237276 [details] [diff] [review]
fix
This is a safe fix for a failure to model the stack accurately. It causes the model to have fewer items on it than expected, which could lead to bad memory conditions. In the specific testcase given in this bug, the only result is a mis-decompilation. But I would rather not take changes, and the fix correctly matches the code generator's stack model.
/be
Attachment #237276 -
Flags: approval1.8.1?
Assignee | ||
Comment 4•18 years ago
|
||
Comment on attachment 237276 [details] [diff] [review]
fix
Something's bad, this patch leads to decompiler string stack overflow.
/be
Attachment #237276 -
Attachment is obsolete: true
Attachment #237276 -
Flags: review+
Attachment #237276 -
Flags: approval1.8.1?
Assignee | ||
Updated•18 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•18 years ago
|
Status: REOPENED → ASSIGNED
Assignee | ||
Comment 5•18 years ago
|
||
Two bugs:
1. EmitSwitch failed to link the SRC_PCDELTA of the last case to the implicit JSOP_DEFAULT it generated after all the cases. This made switch(x){case y:z} decompile with default: labeling z along with case y: !
2. Fixed DecompileSwitch to manage the stack model correctly for the case label / statements order in which it processes bytecode, which does not match the code genartion order (case labels before any case statements -- the JSOP_CASE stack balance of -1 for mismatch instead of -2 for match favors the code gen order, relieving it of the need to fiddle with cg->stackDepth -- the decompiler loses).
/be
Attachment #237297 -
Flags: review?(mrbkap)
Assignee | ||
Updated•18 years ago
|
OS: Mac OS X 10.4 → AIX
Priority: -- → P2
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1
Updated•18 years ago
|
Attachment #237297 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 6•18 years ago
|
||
Fixed on trunk.
/be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•18 years ago
|
||
Comment on attachment 237297 [details] [diff] [review]
fix, v2
Straight-up fixes, local to their containing functions except for the good effects of the EmitSwitch fix on the decompilation of switch statements that use variables in case labels and have no explicit default case.
/be
Attachment #237297 -
Flags: approval1.8.1?
Comment 8•18 years ago
|
||
Comment on attachment 237297 [details] [diff] [review]
fix, v2
a=schrep for drivers.
Attachment #237297 -
Flags: approval1.8.1? → approval1.8.1+
Comment 10•18 years ago
|
||
Checking in regress-351496.js;
/cvsroot/mozilla/js/tests/js1_7/block/regress-351496.js,v <-- regress-351496.js
initial revision: 1.1
done
Flags: in-testsuite+
Comment 11•18 years ago
|
||
verified fixed 1.8 1.9 20060909 windows/mac*/linux
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•