diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 0c07d4fc2cba..22475d59717d 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -271,7 +271,7 @@ static const struct ParamPair { // Keep this in sync with above params. #define GC_PARAMETER_ARGS_LIST "maxBytes, maxMallocBytes, gcBytes, gcNumber, sliceTimeBudget, or markStackLimit" - + static bool GCParameter(JSContext *cx, unsigned argc, Value *vp) { @@ -320,6 +320,11 @@ GCParameter(JSContext *cx, unsigned argc, Value *vp) return false; } + if (param == JSGC_MARK_STACK_LIMIT && IsIncrementalGCInProgress(cx->runtime())) { + JS_ReportError(cx, "attempt to set markStackLimit while a GC is in progress"); + return false; + } + if (param == JSGC_MAX_BYTES) { uint32_t gcBytes = JS_GetGCParameter(cx->runtime(), JSGC_BYTES); if (value < gcBytes) {