Extra "[" in decompilation of nested array comprehensions

VERIFIED FIXED in mozilla1.8.1

Status

()

Core
JavaScript Engine
P1
normal
VERIFIED FIXED
12 years ago
12 years ago

People

(Reporter: Jesse Ruderman, Assigned: brendan)

Tracking

(Blocks: 1 bug, {testcase, verified1.8.1})

Trunk
mozilla1.8.1
testcase, verified1.8.1
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.8.1 +
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [schrep-181approval pending])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

12 years ago
> function(){ [[0 for (x in [])] for (y in []) ]; }

function () { [[0 for (x in [])] for (y in [])[]; }
                                              ^---- does not belong

This causes a syntax error if I try to use the decompiled function.

Comment 1

12 years ago
Created attachment 235609 [details] [diff] [review]
trim xval a little differently

I understand enough of jsopcode.c to be dangerous.


> function(){ [[0 for (x in [])] for (y in []) ]; }
function () { [[0 for (x in [])] for (y in [])]; }

> function(){ [[0 for (x in [])] for (yyyyyyyyyyy in []) ]; }
function () { [[0 for (x in [])] for (yyyyyyyyyyy in [])]; }

> function(){ [0 for (x in [])]; }
function () { [0 for (x in [])]; }

> function(){ [[[0 for (x in [])] for (yyyyyyyyyyy in []) ] for (zzz in [])]; }
function () { [[[0 for (x in [])] for (yyyyyyyyyyy in [])] for (zzz in [])]; }
Attachment #235609 - Flags: review?(brendan)

Updated

12 years ago
Attachment #235609 - Flags: review?(brendan)
(Assignee)

Comment 2

12 years ago
Brave to dive into the bytecode-resugaring hack that is the decompiler!

The patch fixes the testcase in comment 0, but not a variation that makes the initializing expression longer:

js> function(){ [[0 for (x in [])] for (y in []) ]; }
function () {
    [[0 for (x in [])] for (y in [])];
}
js> function(){ [[11 for (x in [])] for (y in []) ]; }
function () {
    [[11 for (x in [])1] for (y in [])];
}

More in a bit.

/be
(Assignee)

Comment 3

12 years ago
Created attachment 235624 [details] [diff] [review]
fix: retract to the point we're overwriting with Sprint

Typo, really -- when you get intermediate decompiler results replayed in the final result, it usually means a failure to pop or retract.

/be
Assignee: general → brendan
Attachment #235609 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #235624 - Flags: superreview?(mrbkap)
Attachment #235624 - Flags: review?(sayrer)
Attachment #235624 - Flags: approval1.8.1?
(Assignee)

Updated

12 years ago
OS: Mac OS X 10.4 → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1
(Assignee)

Comment 4

12 years ago
Safe one character (!) fix for js1.7.

/be
Blocks: 336373
Flags: blocking1.8.1?

Comment 5

12 years ago
Comment on attachment 235624 [details] [diff] [review]
fix: retract to the point we're overwriting with Sprint

> The patch fixes the testcase in comment 0, but not a variation that makes the
> initializing expression longer:
> 

yeah, I cancelled review when I figured that out. :)

r=sayrer
Attachment #235624 - Flags: review?(sayrer) → review+

Updated

12 years ago
Attachment #235624 - Flags: superreview?(mrbkap) → superreview+
(Assignee)

Comment 6

12 years ago
Fixed on trunk.

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED

Updated

12 years ago
Whiteboard: [schrep-181approval pending]

Comment 7

12 years ago
Comment on attachment 235624 [details] [diff] [review]
fix: retract to the point we're overwriting with Sprint

a=schrep/beltnzer for drivers.
Attachment #235624 - Flags: approval1.8.1? → approval1.8.1+

Updated

12 years ago
Flags: blocking1.8.1? → blocking1.8.1+
(Assignee)

Comment 8

12 years ago
Fixed on the 1.8 branch.

/be
Keywords: fixed1.8.1

Comment 9

12 years ago
Checking in regress-349648.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-349648.js,v  <--  regress-349648.js
initial revision: 1.1
Flags: in-testsuite+

Comment 10

12 years ago
verified fixed 1.8 20060828 windows/mac*/linux
Keywords: fixed1.8.1 → verified1.8.1

Comment 11

12 years ago
verified fixed 1.9 20060830 windows/mac*/linux
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.