diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-02 08:50:09 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-02 08:50:09 (GMT) |
commit | e6a1cbed3f72cd41110e40c606acb27a1020644e (patch) | |
tree | e82adafede3300ab91a4bfaf233cc4abe4e6579d /src/script | |
parent | 3a19d617593e324773feae87663d0cfa0d65569a (diff) | |
parent | b991134fe4d90fcd46bab50ba164f2c28b8942db (diff) | |
download | Qt-e6a1cbed3f72cd41110e40c606acb27a1020644e.zip Qt-e6a1cbed3f72cd41110e40c606acb27a1020644e.tar.gz Qt-e6a1cbed3f72cd41110e40c606acb27a1020644e.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-air-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-air-staging:
Don't allow non-Object values to be set as prototype
Enable QtScript/JavaScriptCore ASSERTs in debug mode
Don't assert in abortEvaluation() autotest
Avoid asserting when computing line number for backtrace
Make missing line number info an expected failure
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/qscriptcontextinfo.cpp | 10 | ||||
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 8 | ||||
-rw-r--r-- | src/script/script.pro | 2 |
3 files changed, 16 insertions, 4 deletions
diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp index 0f9de1d..182bc4a 100644 --- a/src/script/api/qscriptcontextinfo.cpp +++ b/src/script/api/qscriptcontextinfo.cpp @@ -159,12 +159,20 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte JSC::CodeBlock *codeBlock = frame->codeBlock(); if (returnPC && codeBlock && QScriptEnginePrivate::hasValidCodeBlockRegister(frame)) { #if ENABLE(JIT) - unsigned bytecodeOffset = codeBlock->getBytecodeIndex(frame, JSC::ReturnAddressPtr(returnPC)); + JSC::JITCode code = codeBlock->getJITCode(); + unsigned jitOffset = code.offsetOf(JSC::ReturnAddressPtr(returnPC).value()); + // We can only use the JIT code offset if it's smaller than the JIT size; + // otherwise calling getBytecodeIndex() is meaningless. + if (jitOffset < code.size()) { + unsigned bytecodeOffset = codeBlock->getBytecodeIndex(frame, JSC::ReturnAddressPtr(returnPC)); #else unsigned bytecodeOffset = returnPC - codeBlock->instructions().begin(); #endif bytecodeOffset--; //because returnPC is on the next instruction. We want the current one lineNumber = codeBlock->lineNumberForBytecodeOffset(const_cast<JSC::ExecState *>(frame), bytecodeOffset); +#if ENABLE(JIT) + } +#endif } } } diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 6037374..079cf92 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -536,7 +536,12 @@ void QScriptValue::setPrototype(const QScriptValue &prototype) Q_D(QScriptValue); if (!d || !d->isObject()) return; - if (prototype.isValid() && QScriptValuePrivate::getEngine(prototype) + + JSC::JSValue other = d->engine->scriptValueToJSCValue(prototype); + if (!other || !(other.isObject() || other.isNull())) + return; + + if (QScriptValuePrivate::getEngine(prototype) && (QScriptValuePrivate::getEngine(prototype) != d->engine)) { qWarning("QScriptValue::setPrototype() failed: " "cannot set a prototype created in " @@ -544,7 +549,6 @@ void QScriptValue::setPrototype(const QScriptValue &prototype) return; } JSC::JSObject *thisObject = JSC::asObject(d->jscValue); - JSC::JSValue other = d->engine->scriptValueToJSCValue(prototype); // check for cycle JSC::JSValue nextPrototypeValue = other; diff --git a/src/script/script.pro b/src/script/script.pro index ce5c778..c558ba8 100644 --- a/src/script/script.pro +++ b/src/script/script.pro @@ -73,7 +73,7 @@ INCLUDEPATH += $$WEBKITDIR/JavaScriptCore/generated # This line copied from WebCore.pro DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1 WTF_CHANGES=1 -DEFINES += NDEBUG +CONFIG(release, debug|release):DEFINES += NDEBUG solaris-g++:isEqual(QT_ARCH,sparc) { CONFIG -= separate_debug_info |