Last Comment Bug 756247 - IonMonkey: Assertion failure: [infer failure] Missing type pushed 0: float, at jsinfer.cpp:353
: IonMonkey: Assertion failure: [infer failure] Missing type pushed 0: float, a...
Status: VERIFIED FIXED
[jsbugmon:update]
: assertion, testcase
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Other Branch
: x86_64 Linux
: -- major (vote)
: ---
Assigned To: Jan de Mooij [:jandem]
:
Mentors:
Depends on:
Blocks: langfuzz IonFuzz
  Show dependency treegraph
 
Reported: 2012-05-17 13:27 PDT by Christian Holler (:decoder)
Modified: 2013-01-14 08:31 PST (History)
6 users (show)
choller: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (4.98 KB, patch)
2012-05-18 06:03 PDT, Jan de Mooij [:jandem]
dvander: review+
Details | Diff | Review

Description Christian Holler (:decoder) 2012-05-17 13:27:37 PDT
The following testcase asserts on ionmonkey revision 14735b4dbccc (run with --ion -n -m --ion-eager):


function foo(i)  {
    var n = 0;
    for (var i = 0; i < (false  ); i++)
      n = a++;
    assertEq(n, 29);
}
var a = foo(10);
Comment 1 Jan de Mooij [:jandem] 2012-05-18 04:10:49 PDT
Reduced it a bit more:

function foo()  {
    var n = 0;
    while (false)
        n = +a;
    print(n); // bailout
}
foo();

The problem is that when we bailout, n is a double (0.0) instead of an integer. The inferred type of "+a" is value -> value, which we compile to MToDouble. Using MToDouble is fine for "value -> double" but for "value -> value" we should probably just call a stub.

Note that value -> int32 has the same problem (double value instead of int32). This testcase also triggers the assert:

function bar(x) {
    var y = +(x ? x : "foo");
    print(y);
}
bar(10);
Comment 2 Jan de Mooij [:jandem] 2012-05-18 06:03:12 PDT
Created attachment 625079 [details] [diff] [review]
Patch

This follows JSOP_NEG and compiles +x as x * 1. Seems like it's the simplest fix and does not regress SS/V8/Kraken.
Comment 3 Jan de Mooij [:jandem] 2012-05-18 12:14:47 PDT
https://hg.mozilla.org/projects/ionmonkey/rev/ceb5ab053f82
Comment 4 Christian Holler (:decoder) 2012-05-18 12:45:55 PDT
JSBugMon: This bug has been automatically verified fixed.
Comment 5 Christian Holler (:decoder) 2013-01-14 08:31:24 PST
A testcase for this bug was automatically identified at js/src/jit-test/tests/ion/bug756247.js.

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