Bug 1233921 - Fix profiler crash when we're doing a debugger bailout. r=shu

--HG--
extra : rebase_source : 481f79748327a7b32261725738469167220344cd
This commit is contained in:
Jan de Mooij 2016-03-24 16:50:28 +01:00
parent c5c65a0d3d
commit 4dd42983c5
2 changed files with 21 additions and 5 deletions

View File

@ -0,0 +1,19 @@
g = newGlobal();
g.parent = this;
g.eval("new Debugger(parent).onExceptionUnwind = function () {}");
enableSPSProfiling();
try {
enableSingleStepProfiling();
} catch(e) {
quit();
}
f();
f();
function $ERROR() {
throw Error;
}
function f() {
try {
$ERROR()
} catch (ex) {}
}

View File

@ -1090,16 +1090,13 @@ InitFromBailout(JSContext* cx, HandleScript caller, jsbytecode* callerPC,
//
// Note that we never resume at this pc, it is set for the sake
// of frame iterators giving the correct answer.
//
// We also set nativeCodeForPC to nullptr as this address
// won't be used anywhere.
jsbytecode* throwPC = script->offsetToPC(iter.pcOffset());
builder.setResumePC(throwPC);
nativeCodeForPC = nullptr;
nativeCodeForPC = baselineScript->nativeCodeForPC(script, throwPC);
} else {
nativeCodeForPC = baselineScript->nativeCodeForPC(script, pc, &slotInfo);
MOZ_ASSERT(nativeCodeForPC);
}
MOZ_ASSERT(nativeCodeForPC);
unsigned numUnsynced = slotInfo.numUnsynced();