Closed Bug 428706 Opened 17 years ago Closed 17 years ago

"Assertion failure: regs.sp < vp"

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
critical

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: igor)

References

Details

(Keywords: assertion, testcase)

Attachments

(1 file, 4 obsolete files)

js> [1 for ([,,] in [])] Assertion failure: regs.sp < vp, at jsinterp.c:6489 This assertion was added in bug 389605.
Assignee: general → igor
Attached patch v1 (obsolete) — Splinter Review
In the patch for bug 389605 I missed that the list comprehension also allows derestructuring pattern for the for loop. This patch fixes this by moving the call to EnsureNonEmptyLet into DestructuringExpr.
Attachment #315312 - Flags: review?(brendan)
Comment on attachment 315312 [details] [diff] [review] v1 I missed that too, alas. Good to fix this quickly, thanks. /be
Attachment #315312 - Flags: review?(brendan)
Attachment #315312 - Flags: review+
Attachment #315312 - Flags: approval1.9?
Comment on attachment 315312 [details] [diff] [review] v1 a1.9=beltzner
Attachment #315312 - Flags: approval1.9? → approval1.9+
Attached patch alternative fix (obsolete) — Splinter Review
This an alternative fix that tries to minimize the amount of code to support "let" with empty destructuring patterns. The idea is to add the synthetic empty property right after [] or {} even if the "let" block or expression would have subsequent non-empty declarations. This is suboptimal from the performance point of view, but simplifies code and makes sure that no destructuring patterns are left unchecked.
Attachment #315312 - Attachment is obsolete: true
Attachment #315514 - Flags: review?(brendan)
Comment on attachment 315514 [details] [diff] [review] alternative fix >+ * would violate this assumption as the there would be no let locals to >+ * store on the stack. To satisfy it we add an empty property to such >+ * blocks so OBJ_BLOCK_COUNT(cx, blockObj), that gives the number of >+ * slots, would be always positive. Suggest "so that OBJ_BLOCK_COUNT(cx, blockObj), which gives ...". >+ * >+ * Note that we add such property even if there would be locals after the Suggest consistent subjunctive or none at all, latter is best: "Note that we add such a property even if the block has locals due to later let declarations in it." Or something like that (missing "a" added before "property" too). /be
Attachment #315514 - Flags: review?(brendan) → review+
Attached patch alternative fix v1b (obsolete) — Splinter Review
The new version of the patch addresses the nits from the comment 5.
Attachment #315514 - Attachment is obsolete: true
Attachment #315942 - Flags: review+
Attachment #315942 - Flags: approval1.9?
Comment on attachment 315942 [details] [diff] [review] alternative fix v1b a1.9=beltzner
Attachment #315942 - Flags: approval1.9? → approval1.9+
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
I backed out the checking to investigate startup segfaults.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch v2 (obsolete) — Splinter Review
Unfortunately I have managed to skip substantial testing of the patch. Running full js shell test suite or mochi test against the code that includes the patch would reveal the regression: I missed that data in CheckDestructuring can be null. But the patch also missed to bump xdr count as, however tiny, it still introduces the bytecode incompatibility. Another bug was that it would not bump BindData.u.let.index when adding the synthetic property. Yet another thing was that the patch used "JSPROP_READONLY | JSPROP_PERMANENT", not "JSPROP_ENUMERATE | JSPROP_PERMANENT", as attributes for the property. Although harmless, after the xdr was not aware of it and would restore the synthetic property as "JSPROP_ENUMERATE | JSPROP_PERMANENT". The new version fixes these and makes sure that the synthetic property behaves in the exactly the same was as normal let names.
Attachment #315942 - Attachment is obsolete: true
I will ask for an review after testing the patch.
Attached patch v2bSplinter Review
The patch now passes shell suite and mochi tests. Compared with v2 the new version bumps the XDR version by 1 to 24, not 25.
Attachment #316408 - Attachment is obsolete: true
Attachment #316559 - Flags: review?(brendan)
Comment on attachment 316559 [details] [diff] [review] v2b r=me, straightforward even if it looks big-ish. /be
Attachment #316559 - Flags: review?(brendan)
Attachment #316559 - Flags: review+
Attachment #316559 - Flags: approval1.9?
Comment on attachment 316559 [details] [diff] [review] v2b a1.9+=damons
Attachment #316559 - Flags: approval1.9? → approval1.9+
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
/cvsroot/mozilla/js/tests/js1_7/regress/regress-428706.js,v <-- regress-428706.js initial revision: 1.1
Flags: in-testsuite+
Flags: in-litmus-
v 1.9.0
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: