Bug 950725 - Fix GetAndClearException to get/clear the exception before calling js_HandleExecutionInterrupt. r=bhackett

This commit is contained in:
Jan de Mooij 2013-12-16 18:50:47 +01:00
parent 53c034b300
commit a823a8daea
3 changed files with 21 additions and 7 deletions

View File

@ -0,0 +1,12 @@
function test() {
+ T[g].act
}
gc();
var c = 0;
for (var i = 0; i < 20; test['$+']) {
if (c++ > 110)
break;
try {
__count__(f(2), 1);
} catch (e) {}
}

View File

@ -1035,7 +1035,7 @@ MarkJitExitFrame(JSTracer *trc, const IonFrameIterator &frame)
MarkIonCodeRoot(trc, footer->addressOfIonCode(), "ion-exit-code");
const VMFunction *f = footer->function();
if (f == nullptr || f->explicitArgs == 0)
if (f == nullptr)
return;
// Mark arguments of the VM wrapper.

View File

@ -3685,14 +3685,16 @@ js::SetCallOperation(JSContext *cx)
bool
js::GetAndClearException(JSContext *cx, MutableHandleValue res)
{
// Check the interrupt flag to allow interrupting deeply nested exception
// handling.
if (cx->runtime()->interrupt && !js_HandleExecutionInterrupt(cx))
return false;
bool status = cx->getPendingException(res);
cx->clearPendingException();
return status;
if (!status)
return false;
// Check the interrupt flag to allow interrupting deeply nested exception
// handling.
if (cx->runtime()->interrupt)
return js_HandleExecutionInterrupt(cx);
return true;
}
template <bool strict>