Avoid uninitialized ExecutionContext::current pointer
authorSimon Hausmann <simon.hausmann@digia.com>
Sat, 8 Dec 2012 20:12:11 +0000 (21:12 +0100)
committerLars Knoll <lars.knoll@digia.com>
Wed, 12 Dec 2012 10:38:19 +0000 (11:38 +0100)
Change-Id: I63fb1fbb39786fc349ccc121a25951b15ec31d57
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
qmljs_environment.cpp

index caf8915..2a49a67 100644 (file)
@@ -385,6 +385,7 @@ void ExecutionContext::initCallContext(ExecutionContext *parent, const Value tha
 
     engine = parent->engine;
     this->parent = parent;
+    engine->current = this;
 
     function = f;
     strictMode = f->strictMode;
@@ -429,7 +430,9 @@ void ExecutionContext::leaveCallContext()
         delete[] locals;
         locals = 0;
     }
+    engine->current = parent;
     parent = 0;
+    function = 0;
 
     if (engine->debugger)
         engine->debugger->justLeft(this);