Last Comment Bug 695017 - IonMonkey: Null Increment error
: IonMonkey: Null Increment error
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: David Anderson [:dvander]
:
:
Mentors:
Depends on:
Blocks: 677337
  Show dependency treegraph
 
Reported: 2011-10-17 09:16 PDT by Nicolas B. Pierron [:nbp]
Modified: 2011-11-07 16:04 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix (702 bytes, patch)
2011-10-28 13:48 PDT, David Anderson [:dvander]
no flags Details | Diff | Splinter Review
fix (6.08 KB, patch)
2011-10-28 13:54 PDT, David Anderson [:dvander]
cdleary: review+
Details | Diff | Splinter Review

Description Nicolas B. Pierron [:nbp] 2011-10-17 09:16:08 PDT
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);
Comment 1 David Anderson [:dvander] 2011-10-27 18:47:00 PDT
The bug here is that jsop_localinc/jsop_arginc do not ToNumber() their inputs.
Comment 2 David Anderson [:dvander] 2011-10-28 13:48:53 PDT
Created attachment 570349 [details] [diff] [review]
fix

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.
Comment 3 David Anderson [:dvander] 2011-10-28 13:54:54 PDT
Created attachment 570351 [details] [diff] [review]
fix

wrong patch
Comment 4 Chris Leary [:cdleary] (not checking bugmail) 2011-11-04 15:58:15 PDT
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'?
Comment 5 David Anderson [:dvander] 2011-11-07 16:04:56 PST
http://hg.mozilla.org/projects/ionmonkey/rev/70953dad5e78

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