mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 12:37:37 +00:00
[INFER] Fix bogus assert when restoring analysis types, bug 642254.
This commit is contained in:
parent
2816a7707c
commit
b875c13ba0
4
js/src/jit-test/tests/basic/bug642254.js
Normal file
4
js/src/jit-test/tests/basic/bug642254.js
Normal file
@ -0,0 +1,4 @@
|
||||
function f(i) {
|
||||
for (var n = 0; n < 0; n = i) { }
|
||||
}
|
||||
actual = f(.5);
|
@ -5704,16 +5704,18 @@ mjit::Compiler::restoreAnalysisTypes(uint32 stackDepth)
|
||||
JSValueType type = knownLocalType(i);
|
||||
if (type != JSVAL_TYPE_UNKNOWN && (type != JSVAL_TYPE_DOUBLE || !analysis->localEscapes(i))) {
|
||||
FrameEntry *fe = frame.getLocal(i);
|
||||
JS_ASSERT(!fe->isTypeKnown());
|
||||
frame.learnType(fe, type, false);
|
||||
JS_ASSERT_IF(fe->isTypeKnown(), fe->isType(type));
|
||||
if (!fe->isTypeKnown())
|
||||
frame.learnType(fe, type, false);
|
||||
}
|
||||
}
|
||||
for (uint32 i = 0; fun && i < fun->nargs; i++) {
|
||||
JSValueType type = knownArgumentType(i);
|
||||
if (type != JSVAL_TYPE_UNKNOWN && (type != JSVAL_TYPE_DOUBLE || !analysis->argEscapes(i))) {
|
||||
FrameEntry *fe = frame.getArg(i);
|
||||
JS_ASSERT(!fe->isTypeKnown());
|
||||
frame.learnType(fe, type, false);
|
||||
JS_ASSERT_IF(fe->isTypeKnown(), fe->isType(type));
|
||||
if (!fe->isTypeKnown())
|
||||
frame.learnType(fe, type, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user