Bug 617139: extend stack check further to allow for GC during exception generation for too much recursion, r=igor, a=blocker

This commit is contained in:
David Mandelin 2010-12-30 13:30:12 -08:00
parent 698339e641
commit 340aa6ac81
2 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,9 @@
// |jit-test| error: InternalError
// don't assert
gczeal(2)
function x() {
[null].some(x)
}
x();

View File

@ -2524,10 +2524,10 @@ js_GC(JSContext *cx, JSGCInvocationKind gckind)
# if JS_STACK_GROWTH_DIRECTION > 0
/* cx->stackLimit is set to jsuword(-1) by default. */
JS_ASSERT_IF(cx->stackLimit != jsuword(-1),
JS_CHECK_STACK_SIZE(cx->stackLimit + 4096, &stackDummy));
JS_CHECK_STACK_SIZE(cx->stackLimit + (1 << 14), &stackDummy));
# else
/* -4k because it is possible to perform a GC during an overrecursion report. */
JS_ASSERT_IF(cx->stackLimit, JS_CHECK_STACK_SIZE(cx->stackLimit - 4096, &stackDummy));
/* -16k because it is possible to perform a GC during an overrecursion report. */
JS_ASSERT_IF(cx->stackLimit, JS_CHECK_STACK_SIZE(cx->stackLimit - (1 << 14), &stackDummy));
# endif
#endif