diff options
Diffstat (limited to 'src/qml/jsruntime/qv4debugging.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4debugging.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index ca5af36f1c..483d75011a 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -67,10 +67,12 @@ public: ExecutionContextSaver saver(scope, engine->currentContext()); - Value *savedContexts = scope.alloc(frameNr); - for (int i = 0; i < frameNr; ++i) { - savedContexts[i] = engine->currentContext(); - engine->popContext(); + if (frameNr > 0) { + Value *savedContexts = scope.alloc(frameNr); + for (int i = 0; i < frameNr; ++i) { + savedContexts[i] = engine->currentContext(); + engine->popContext(); + } } ScopedContext ctx(scope, engine->currentContext()); |
