mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 738279 - Change 'pc' to match 'sp' in forced return path (r=bhackett)
--HG-- extra : rebase_source : 24cecb569cdb5df33737877bc3f02a5ceea342b1
This commit is contained in:
parent
6ffef1aa05
commit
f604f5398d
24
js/src/jit-test/tests/debug/testEarlyReturnOnCall.js
Normal file
24
js/src/jit-test/tests/debug/testEarlyReturnOnCall.js
Normal 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);
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user