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 a835d835fb..50142ab155 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -65,10 +65,12 @@ public: ExecutionContextSaver saver(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(); + } } ExecutionContext *ctx = engine->currentContext(); |
