Closed Bug 740443 Opened 12 years ago Closed 12 years ago

ALIASEDVAR Patch: Assertion failure: function()->isHeavyweight(), at jsscript.cpp:1928

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: decoder, Assigned: luke)

References

Details

(Keywords: assertion, testcase)

The following test asserts on mozilla-central revision 7ed31daf07bd with patch from bug 740259 (options -m -n):


function foo(x) {}
var q = foo(0  + .5);
function testAddAnyInconvertibleObject( isNaN, Uint16Array ) {
  var count = 0;
  function toString() { 
        return "" + count; 
  }
  function toString (  )  {  }      
}
q(testAddAnyInconvertibleObject(), "pass");
Hah, this one is great!

We parse the first toString, note the upvar, parse the second toString (which has no upvars), then, when it comes time to emit, we only emit the second (since the first is inaccessible).  Since heavyweight-ness gets set in AnalyzeFunctions, we never set heavyweight on the outer function.  Thus, you get an aliased var in a non-heavyweight function, hence the assertion.  The real fix is to kill off AnalyzeFunctions, which I plan to do, but, as a first step, I'll have notClosedVar/Arg flag heavyweight.

Test-case and fix will be in bug 740259.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Fixed by patch in bug 740259 -> FIXED
Resolution: DUPLICATE → FIXED
You need to log in before you can comment on or make changes to this bug.