Bug 1199175 - Fix Debugger::slowPathOnLeaveFrame to remove the frame on OOM too. r=shu

This commit is contained in:
Jan de Mooij 2015-09-19 20:00:14 +02:00
parent ffc566e9ff
commit 0956ce920d

View File

@ -601,6 +601,13 @@ Debugger::slowPathOnLeaveFrame(JSContext* cx, AbstractFramePtr frame, bool frame
if (frameRange.empty())
return frameOk;
auto frameMapsGuard = MakeScopeExit([&] {
// Clean up all Debugger.Frame instances. This call creates a fresh
// FrameRange, as one debugger's onPop handler could have caused another
// debugger to create its own Debugger.Frame instance.
removeFromFrameMapsAndClearBreakpointsIn(cx, frame);
});
/* Save the frame's completion value. */
JSTrapStatus status;
RootedValue value(cx);
@ -661,13 +668,6 @@ Debugger::slowPathOnLeaveFrame(JSContext* cx, AbstractFramePtr frame, bool frame
}
}
/*
* Clean up all Debugger.Frame instances. This call creates a fresh
* FrameRange, as one debugger's onPop handler could have caused another
* debugger to create its own Debugger.Frame instance.
*/
removeFromFrameMapsAndClearBreakpointsIn(cx, frame);
/* Establish (status, value) as our resumption value. */
switch (status) {
case JSTRAP_RETURN: