Add missing comparison before letting the result of the conditional move flow into the guard for ordered boolean comparisons (457778, r=danderson).

This commit is contained in:
Andreas Gal 2008-10-07 13:32:30 -07:00
parent 1b0fd40e30
commit 52f71e38dc
2 changed files with 9 additions and 0 deletions

View File

@ -3419,6 +3419,7 @@ TraceRecorder::cmp(LOpcode op, int flags)
JSVAL_TO_BOOLEAN(JSVAL_VOID)),
lir->insImm(JSVAL_TO_BOOLEAN(JSVAL_FALSE)),
x);
x = lir->ins_eq0(lir->ins_eq0(x));
if ((l == JSVAL_VOID) || (r == JSVAL_VOID))
cond = false;
}

View File

@ -2071,6 +2071,14 @@ function testResumeOp() {
testResumeOp.expected = "16151413121110987654321";
test(testResumeOp);
function testUndefinedCmp() {
var a = false;
for (var j = 0; j < 4; ++j) { if (undefined < false) { a = true; } }
return a;
}
testUndefinedCmp.expected = false;
test(testUndefinedCmp);
/* Keep these at the end so that we can see the summary after the trace-debug spew. */
print("\npassed:", passes.length && passes.join(","));
print("\nFAILED:", fails.length && fails.join(","));