Last Comment Bug 747554 - "Assertion failure: script->varIsAliased(i),"
: "Assertion failure: script->varIsAliased(i),"
: assertion, regression, testcase
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: x86 Mac OS X
-- critical (vote)
: mozilla15
Assigned To: Luke Wagner [:luke]
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: jsfunfuzz 740259
  Show dependency treegraph
Reported: 2012-04-20 15:04 PDT by Gary Kwong [:gkw] [:nth10sd]
Modified: 2013-01-14 08:09 PST (History)
4 users (show)
choller: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

stack (3.59 KB, text/plain)
2012-04-20 15:04 PDT, Gary Kwong [:gkw] [:nth10sd]
no flags Details
fix and test (4.90 KB, patch)
2012-04-20 17:31 PDT, Luke Wagner [:luke]
jwalden+bmo: review+
Details | Diff | Splinter Review

Description User image Gary Kwong [:gkw] [:nth10sd] 2012-04-20 15:04:58 PDT
Created attachment 617114 [details]

(function() {
    switch ({
    } = 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)
Comment 1 User image Luke Wagner [:luke] 2012-04-20 17:31:56 PDT
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.
Comment 2 User image Jeff Walden [:Waldo] (remove +bmo to email) 2012-04-27 19:27:39 PDT
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.
Comment 4 User image Ed Morley [:emorley] 2012-05-04 11:40:22 PDT
Comment 5 User image Christian Holler (:decoder) 2013-01-14 08:09:22 PST
A testcase for this bug was automatically identified at js/src/jit-test/tests/basic/testBug747554.js.

Note You need to log in before you can comment on or make changes to this bug.