From e04f44a4746928346b90acf74ec0bb67fee3c0d6 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 18 Sep 2009 15:47:23 +0200 Subject: 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 --- src/script/api/qscriptengine.cpp | 1 + 1 file changed, 1 insertion(+) 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()); -- cgit v0.12