Closed Bug 350279 Opened 18 years ago Closed 18 years ago

"Assertion failure: left->pn_type == TOK_RC" [@ CheckDestructuring]

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8.1

People

(Reporter: jruderman, Assigned: brendan)

Details

(Keywords: crash, testcase, verified1.8.1)

Crash Data

Attachments

(1 file, 1 obsolete file)

javascript:let [2 for (x in [])] = 4;

Assertion failure: left->pn_type == TOK_RC, at jsparse.c:2121
Attached patch fix (obsolete) — Splinter Review
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #237044 - Flags: review?(mrbkap)
Maybe the nearby "goto no_var_name" thing nearby should handle jumping out more like this does?
(In reply to comment #2)
> Maybe the nearby "goto no_var_name" thing nearby should handle jumping out more
> like this does?

That case shares code at no_var_name with other downward gotos on error.  This new case is unique.  Therefore there is nothing more to share than via label bad.

/be
Comment on attachment 237044 [details] [diff] [review]
fix

>Index: jsparse.c
>     fpvd.table.ops = NULL;
>     lhs = left->pn_head;
>+    if (left->pn_type == TOK_ARRAYCOMP) {
>+        js_ReportCompileErrorNumber(cx, left, JSREPORT_PN | JSREPORT_ERROR,
>+                                    JSMSG_ARRAY_COMP_LEFTSIDE);
>+        goto bad;
>+    }
> ...
> out:
>     if (fpvd.table.ops)
>         JS_DHashTableFinish(&fpvd.table);

I don't really see why we need to goto out: here. return JS_FALSE seems like it would be just as correct and avoid the additional label and double-goto.

r=mrbkap either way.
Attachment #237044 - Flags: review?(mrbkap) → review+
Attached patch fix, v2Splinter Review
Good point, we can check for this error right away.  No need to partake of the out: code that other paths through no_var_name: need for cleanup.

/be
Attachment #237044 - Attachment is obsolete: true
Attachment #237059 - Flags: review?(mrbkap)
Attachment #237044 - Flags: review+
Attachment #237059 - Flags: review?(mrbkap) → review+
Attachment #237059 - Flags: review?
Fixed on trunk.

/be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
OS: Mac OS X 10.4 → All
Priority: -- → P2
Hardware: Macintosh → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8.1
Comment on attachment 237059 [details] [diff] [review]
fix, v2

This assertion catches a missing error check, which becomes a crash in release builds.  Safe fix, no point in risking anything by not taking it even if we didn't care about the crash instead of an error message.

/be
Attachment #237059 - Flags: approval1.8.1?
Checking in regress-350279.js;
/cvsroot/mozilla/js/tests/js1_7/block/regress-350279.js,v  <--  regress-350279.js
initial revision: 1.1
Flags: in-testsuite+
Comment on attachment 237059 [details] [diff] [review]
fix, v2

a=beltzner on behalf of 181drivers
Attachment #237059 - Flags: approval1.8.1? → approval1.8.1+
Fixed on the 1.8 branch.

/be
Keywords: fixed1.8.1
verified fixed 1.9a1_2006090707 windows/mac*/linux
Status: RESOLVED → VERIFIED
verified fixed 1.8 1.9 20060909 windows/mac*/linux
Crash Signature: [@ CheckDestructuring]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: