Bug 1054601 - Don't unroll loops which aren't actually loops, r=jandem.

This commit is contained in:
Brian Hackett 2014-09-09 08:15:35 -06:00
parent 377633cc99
commit 4c9269f85a
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,8 @@
(function() {
for (let x = 0; x < 1; ++x) {
if (x % 6 == 4) {} else {
return;
}
}
})()

View File

@ -115,7 +115,10 @@ LoopUnroller::go(LoopIterationBound *bound)
JitSpew(JitSpew_Unrolling, "Attempting to unroll loop");
header = bound->header;
JS_ASSERT(header->isLoopHeader());
// UCE might have determined this isn't actually a loop.
if (!header->isLoopHeader())
return;
backedge = header->backedge();
oldPreheader = header->loopPredecessor();