Bug 738279 - Change 'pc' to match 'sp' in forced return path (r=bhackett)

--HG--
extra : rebase_source : 24cecb569cdb5df33737877bc3f02a5ceea342b1
This commit is contained in:
Luke Wagner 2012-04-09 09:12:44 -07:00
parent 6ffef1aa05
commit f604f5398d
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,24 @@
var g = newGlobal('new-compartment');
g.eval("var success = false");
g.eval("function ponies() {}");
g.eval("function foo() { ponies(); success = false }");
var dbg = new Debugger(g);
dbg.onEnterFrame = function(frame) {
// The goal here is force an early return on the 'call' instruction,
// which should be the 3rd step (callgname, undefined, call)
var step = 0;
frame.onStep = function() {
++step;
if (step == 2) {
g.success = true;
return;
}
if (step == 3)
return { return: undefined }
}
frame.onPop = function() { new Error(); /* boom */ }
}
g.foo();
assertEq(g.success, true);

View File

@ -4134,6 +4134,8 @@ END_CASE(JSOP_ARRAYPUSH)
forced_return:
UnwindScope(cx, 0);
regs.sp = regs.fp()->base();
regs.pc = script->code + script->length - JSOP_STOP_LENGTH;
JS_ASSERT(*regs.pc == JSOP_STOP);
if (entryFrame != regs.fp())
goto inline_return;