diff options
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 933241ea27..ada6941381 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -478,7 +478,10 @@ public: void assertObjectBelongsToEngine(const Heap::Base &baseObject); - bool checkStackLimits(ReturnedValue &exception); + bool checkStackLimits(Scope &scope); + +private: + void failStackLimitCheck(Scope &scope); }; // This is a trick to tell the code generators that functions taking a NoThrowContext won't @@ -571,7 +574,7 @@ inline void Value::mark(ExecutionEngine *e) o->mark(e); } -#define CHECK_STACK_LIMITS(v4) { ReturnedValue e; if ((v4)->checkStackLimits(e)) return e; } \ +#define CHECK_STACK_LIMITS(v4, scope) if ((v4)->checkStackLimits(scope)) return; \ ExecutionEngineCallDepthRecorder _executionEngineCallDepthRecorder(v4); struct ExecutionEngineCallDepthRecorder @@ -582,10 +585,10 @@ struct ExecutionEngineCallDepthRecorder ~ExecutionEngineCallDepthRecorder() { --ee->callDepth; } }; -inline bool ExecutionEngine::checkStackLimits(ReturnedValue &exception) +inline bool ExecutionEngine::checkStackLimits(Scope &scope) { if (Q_UNLIKELY((jsStackTop > jsStackLimit) || (callDepth >= maxCallDepth))) { - exception = throwRangeError(QStringLiteral("Maximum call stack size exceeded.")); + failStackLimitCheck(scope); return true; } |