Closed Bug 660173 Opened 9 years ago Closed 9 years ago

TI: correctness bug with "return (x = arguments)"

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: jandem, Unassigned)

References

(Blocks 1 open bug)

Details

--
(function() {}).apply(null, (function() {
    var x;
    return (x = arguments);  
})());
--
This throws with -a -n:
typein:1: TypeError: second argument to Function.prototype.apply must be an array

Revision e62ab4bbe727, 32-bit OS X.
A bit simpler maybe:
--
(function() {
    var x;
    var y = (x = arguments);
    assertEq(typeof y, "object");
})();
--
This asserts with -a -n:
Assertion failure: v.isBoolean(), at jsinterp.cpp:1251
In the arguments escape analysis at SETLOCAL we would only follow uses of the variable being assigned to, not uses of the value pushed by the SETLOCAL.

http://hg.mozilla.org/projects/jaegermonkey/rev/e9b44ad197a5
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.