summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-10-06 11:19:40 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-10-06 11:28:01 +0200
commitc8d2160f3aa9b6709874c9cf4a634a46728d6cc6 (patch)
treea8e1c8ff4156c5f668da7ee28005cf93ff3fa062 /src/script
parent65a101502bb04ea95110ce6e12a3848c790eb7a1 (diff)
QtScript: Another crash fix on PowerPC
on 32bit PowerPC, the integer value and the pointer value are not in the same word leading to crash. So blindly casting between them lead to crashes. Use the new Register::withInt instead Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 3402190768..863ac30f32 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -1116,8 +1116,7 @@ uint QScriptEnginePrivate::contextFlags(JSC::ExecState *exec)
void QScriptEnginePrivate::setContextFlags(JSC::ExecState *exec, uint flags)
{
Q_ASSERT(!exec->codeBlock());
- quintptr flag_ptr = flags;
- exec->registers()[JSC::RegisterFile::ReturnValueRegister] = JSC::JSValue(reinterpret_cast<JSC::JSObject*>(flag_ptr));
+ exec->registers()[JSC::RegisterFile::ReturnValueRegister] = JSC::Register::withInt(flags);
}