diff --git a/js/src/jit-test/tests/jaeger/bug684824.js b/js/src/jit-test/tests/jaeger/bug684824.js new file mode 100644 index 00000000000..9e8ad9c7ee7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/bug684824.js @@ -0,0 +1,7 @@ + +function X(n) { + while ('' + (n--)) { + break; + } +} +X(); diff --git a/js/src/methodjit/Compiler.cpp b/js/src/methodjit/Compiler.cpp index f1c15705272..fd2765a9c87 100644 --- a/js/src/methodjit/Compiler.cpp +++ b/js/src/methodjit/Compiler.cpp @@ -7216,7 +7216,12 @@ mjit::Compiler::updateJoinVarTypes() if (newv->slot < TotalSlots(script)) { VarType &vt = a->varTypes[newv->slot]; vt.types = analysis->getValueTypes(newv->value); - vt.type = vt.types->getKnownTypeTag(cx); + JSValueType newType = vt.types->getKnownTypeTag(cx); + if (newType != vt.type) { + FrameEntry *fe = frame.getSlotEntry(newv->slot); + frame.forgetLoopReg(fe); + } + vt.type = newType; } newv++; }