"Assertion failure: script->varIsAliased(i),"

RESOLVED FIXED in mozilla15

Status

()

Core
JavaScript Engine
--
critical
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gkw, Assigned: luke)

Tracking

(Blocks: 1 bug, {assertion, regression, testcase})

Trunk
mozilla15
x86
Mac OS X
assertion, regression, testcase
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: js-triage-needed)

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
Created attachment 617114 [details]
stack

(function() {
    switch ({
        z
    } = gc) {
    case n:
        function e() {}
        var z
    }
})()

asserts js debug shell on m-c changeset 17af008937e3 without any CLI arguments at Assertion failure: script->varIsAliased(i),

autoBisect shows this is probably related to the following changeset:

The first bad revision is:
changeset:   91357:4c298ca28fa6
user:        Luke Wagner
date:        Fri Mar 16 12:02:37 2012 -0700
summary:     Bug 740259 - Assert that dynamic binding access is expected (r=bhackett)
(Assignee)

Comment 1

5 years ago
Created attachment 617156 [details] [diff] [review]
fix and test

Ah, the root of this evil is destructuring short-hand: when we parse the 'x' in '{x} = blah', we parse 'x' as a property name.  That means we don't use Parser::identifierName (like all other names) which means we never link the use to def which means we emit a dynamic name lookup for 'x' which triggers the "I thought this wasn't aliased" assertion added for ALIASEDVAR.

The fix is to do the def-use linking in CheckDestructuring by sharing code with identifierName.
Assignee: general → luke
Status: NEW → ASSIGNED
Attachment #617156 - Flags: review?(jwalden+bmo)
Comment on attachment 617156 [details] [diff] [review]
fix and test

Review of attachment 617156 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/frontend/Parser.cpp
@@ +6684,5 @@
>  #endif
>                 ) && !(tc->flags & TCF_DECL_DESTRUCTURING))
>      {
> +        if (!NoteNameUse(node, tc))
> +            return false;

NULL, you warning-introducer you.
Attachment #617156 - Flags: review?(jwalden+bmo) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/be0709aa4730
Target Milestone: --- → mozilla15

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/be0709aa4730
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
A testcase for this bug was automatically identified at js/src/jit-test/tests/basic/testBug747554.js.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.