Closed Bug 355049 Opened 18 years ago Closed 18 years ago

decompilation of for..in destructuring into two holes causes "Assertion failure: pos != 0"

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9alpha1

People

(Reporter: jruderman, Assigned: brendan)

References

Details

(Keywords: crash, testcase, verified1.8.1.1)

Attachments

(1 file)

js> function () { [3 for ([, , ] in null)] }
js> 

js> function () { [3 for each ([, , ] in null)] }
js> 

In a debug build, I get "Assertion failure: pos != 0, at jsopcode.c:2512".
This is slightly different, in that the *initial value*, rather than the thing being destructured into, is two holes.  Is this the same bug?

js> for(var [[[]], x] = [,,] in {}) { }
Assertion failure: j < n, at jsopcode.c:1133
Attached patch fixSplinter Review
Empty destructurers are allowed per the ES4 proposal, so JSOP_ARRAYPUSH's decompiler must cope.

/be
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #241425 - Flags: review?(mrbkap)
Blocks: js1.7src
Flags: blocking1.8.1.1?
OS: Mac OS X 10.4 → All
Priority: -- → P2
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.9alpha
(In reply to comment #1)
> This is slightly different, in that the *initial value*, rather than the thing
> being destructured into, is two holes.  Is this the same bug?
> 
> js> for(var [[[]], x] = [,,] in {}) { }
> Assertion failure: j < n, at jsopcode.c:1133

Different bug, please file separately.

/be

Comment 1 is now bug 355660.
Attachment #241425 - Flags: review?(mrbkap) → review+
Attachment #241425 - Flags: approval1.8.1.1?
Checking in jsopcode.c;
/cvsroot/mozilla/js/src/jsopcode.c,v  <--  jsopcode.c
new revision: 3.191; previous revision: 3.190
done

/be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Checking in regress-355049-01.js;
/cvsroot/mozilla/js/tests/js1_7/regress/regress-355049-01.js,v  <--  regress-355049-01.js
initial revision: 1.1
done
RCS file: /cvsroot/mozilla/js/tests/js1_7/regress/regress-355049-02.js,v
done
Checking in regress-355049-02.js;
/cvsroot/mozilla/js/tests/js1_7/regress/regress-355049-02.js,v  <--  regress-355049-02.js
initial revision: 1.1
done
Flags: in-testsuite+
verified fixed 1.9 20061007 windows/linux
Status: RESOLVED → VERIFIED
Flags: blocking1.8.1.1? → blocking1.8.1.1+
Comment on attachment 241425 [details] [diff] [review]
fix

approved for 1.8 branch, a=dveditz for drivers
Attachment #241425 - Flags: approval1.8.1.1? → approval1.8.1.1+
Fixed on 1.8 branch:

Checking in jsopcode.c;
/cvsroot/mozilla/js/src/jsopcode.c,v  <--  jsopcode.c
new revision: 3.89.2.64; previous revision: 3.89.2.63
done

/be
Keywords: fixed1.8.1.1
verified fixed 20061122 1.8.1.1 windows/linux/mac*, 1.9 windows/linux
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: