Bug 752379 - ContextStack::pushExecuteFrame should read the most recent 'fp' (r=bhackett)

--HG--
extra : rebase_source : 1b615fbb8bebab0bf5acd859a70b34ae405347a6
This commit is contained in:
Luke Wagner 2012-05-07 09:15:08 -07:00
parent d40c032d4c
commit 169c45f7b8
2 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1,10 @@
var lfcode = new Array();
lfcode.push("");
lfcode.push("print('hi');");
while (true) {
var file = lfcode.shift(); if (file == undefined) { break; }
loadFile(file);
}
function loadFile(lfVarx) {
evaluate(lfVarx);
}

View File

@ -807,7 +807,6 @@ ContextStack::pushExecuteFrame(JSContext *cx, JSScript *script, const Value &thi
* below.
*/
CallArgsList *evalInFrameCalls = NULL; /* quell overwarning */
StackFrame *prev;
MaybeExtend extend;
if (evalInFrame) {
/* Though the prev-frame is given, need to search for prev-call. */
@ -815,10 +814,8 @@ ContextStack::pushExecuteFrame(JSContext *cx, JSScript *script, const Value &thi
while (!iter.isScript() || iter.fp() != evalInFrame)
++iter;
evalInFrameCalls = iter.calls_;
prev = evalInFrame;
extend = CANT_EXTEND;
} else {
prev = maybefp();
extend = CAN_EXTEND;
}
@ -827,6 +824,7 @@ ContextStack::pushExecuteFrame(JSContext *cx, JSScript *script, const Value &thi
if (!firstUnused)
return NULL;
StackFrame *prev = evalInFrame ? evalInFrame : maybefp();
StackFrame *fp = reinterpret_cast<StackFrame *>(firstUnused + 2);
fp->initExecuteFrame(script, prev, seg_->maybeRegs(), thisv, scopeChain, type);
SetValueRangeToUndefined(fp->slots(), script->nfixed);