summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-09-18 13:47:23 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-09-18 14:06:01 (GMT)
commite04f44a4746928346b90acf74ec0bb67fee3c0d6 (patch)
treeb5445b435d95d49cb7e8c3127d7b33a92590510a /src/script/api
parentd380d3435d413fab28192175da30845ca3351752 (diff)
downloadQt-e04f44a4746928346b90acf74ec0bb67fee3c0d6.zip
Qt-e04f44a4746928346b90acf74ec0bb67fee3c0d6.tar.gz
Qt-e04f44a4746928346b90acf74ec0bb67fee3c0d6.tar.bz2
initialize the this-register of the global context
QScriptEnginePrivate::thisForContext() relies on the this-register of the global context to contain an invalid JSValue. The default Register constructor (used to initialize the registers of the global context) only invalidates its value when NDEBUG is not defined (but we define it). Therefore, we must explicitly set the this-register to an invalid value. Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptengine.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 163cf5f..cb47f5d 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -803,6 +803,7 @@ QScriptEnginePrivate::QScriptEnginePrivate()
JSC::JSGlobalObject *globalObject = new (globalData)QScript::GlobalObject();
JSC::ExecState* exec = globalObject->globalExec();
+ *thisRegisterForFrame(exec) = JSC::JSValue();
scriptObjectStructure = QScriptObject::createStructure(globalObject->objectPrototype());