Bug 787921 - Fix IonMonkey interrupt detection. r=dvander

This commit is contained in:
Sean Stangl 2012-09-06 16:34:48 -07:00
parent 516460a8dc
commit 723d6c73f7
3 changed files with 17 additions and 4 deletions

View File

@ -101,8 +101,8 @@ CheckOverRecursed(JSContext *cx)
// (1) The interrupt bit is set, and we need to fire the interrupt callback.
// (2) The stack limit has been exceeded, and we need to throw an error.
//
// Note that we can reach here if ionStackLimit is NULL, but interrupt has
// not yet been set to 1. That's okay; it will be set to 1 very shortly,
// Note that we can reach here if ionStackLimit is MAXADDR, but interrupt
// has not yet been set to 1. That's okay; it will be set to 1 very shortly,
// and in the interim we might just fire a few useless calls to
// CheckOverRecursed.
JS_CHECK_RECURSION(cx, return false);

View File

@ -0,0 +1,13 @@
// |jit-test| error: InternalError: too much recursion
function TestCase(n, d, e, a) {
this.bugnumber = typeof(BUGNUMER) != 'undefined' ? BUGNUMBER : '';
this.type = (typeof window == 'undefined' ? 'shell' : 'browser');
gTestcases[gTc++] = this;
if (optionName && optionName != "allow_xml") {}
{} {} {} // Seems to be required to crash
}
function f() {}
function g(n, h) {
var t = g(TestCase.toSource());
}
g(80, f);

View File

@ -169,9 +169,9 @@ JSRuntime::triggerOperationCallback()
* Invalidate ionTop to trigger its over-recursion check. Note this must be
* set before interrupt, to avoid racing with js_InvokeOperationCallback,
* into a weird state where interrupt is stuck at 0 but ionStackLimit is
* NULL.
* MAXADDR.
*/
ionStackLimit = 0;
ionStackLimit = -1;
/*
* Use JS_ATOMIC_SET in the hope that it ensures the write will become