Closed Bug 695017 Opened 13 years ago Closed 13 years ago

IonMonkey: Null Increment error

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: nbp, Assigned: dvander)

References

Details

Attachments

(1 file, 1 obsolete file)

The test basic/testNullIncrement.js started to fail, after the implementation of Bug 691340. The test can be simplified to test without waiting for Bug 691340 fix: function f() { var n = null; return n++; } print(f()); assertEq(f(), 0);
Blocks: 677337
No longer blocks: IonMonkey
The bug here is that jsop_localinc/jsop_arginc do not ToNumber() their inputs.
Assignee: general → dvander
Status: NEW → ASSIGNED
Attached patch fix (obsolete) (deleted) — Splinter Review
The bug is that localinc/arginc weren't performing a ToNumber conversion. It was implicit in the type policy for Add, which isn't really correct since it has to happen on the local, not the stack.
Attachment #570349 - Flags: review?(cdleary)
Attached patch fix (deleted) — Splinter Review
wrong patch
Attachment #570349 - Attachment is obsolete: true
Attachment #570349 - Flags: review?(cdleary)
Attachment #570351 - Flags: review?(cdleary)
Comment on attachment 570351 [details] [diff] [review] fix Review of attachment 570351 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/ion/IonBuilder.cpp @@ +1771,5 @@ > + bool post = !!(js_CodeSpec[op].format & JOF_POST); > + TypeOracle::Binary types = oracle->binaryOp(script, pc); > + > + // Grab the value at the local slot, and convert it to a number. Currently, > + // we use ToInt32 or ToNumber which are idempotent. This whole operation Can we say, 'fallible, but idempotent'?
Attachment #570351 - Flags: review?(cdleary) → review+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: