diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-02-28 14:53:10 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2011-03-01 09:21:36 (GMT) |
commit | 5c7b7f5fca8c557b14959ca338cb2fa62aea6aa0 (patch) | |
tree | 2dffbc2ed8ff719d7be472427223274924338360 /tests/auto/qscriptcontext | |
parent | 94a654a67296b37a882a829d3c65d4abd12b4a1c (diff) | |
download | Qt-5c7b7f5fca8c557b14959ca338cb2fa62aea6aa0.zip Qt-5c7b7f5fca8c557b14959ca338cb2fa62aea6aa0.tar.gz Qt-5c7b7f5fca8c557b14959ca338cb2fa62aea6aa0.tar.bz2 |
Avoid asserting when computing line number for backtrace
With JSC asserts enabled (QtScript built without NDEBUG
defined), JSC::CodeBlock::getBytecodeIndex() would assert
because we sometimes called it with an address that was not
inside the range of the block's JIT code.
We never caught this bug because it just so happens that
even though the assert fails, the function returns a
result that causes our autotests to pass.
Check that the returnPC is in range and report lineNumber
-1 if not; this unifies the behavior of the interpreter
and JIT, even though it's not the result we want.
Task-number: QTBUG-17741
Reviewed-by: Olivier Goffart
Diffstat (limited to 'tests/auto/qscriptcontext')
-rw-r--r-- | tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp index f4833bf..457188c 100644 --- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp +++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp @@ -981,10 +981,8 @@ void tst_QScriptContext::backtrace() QVERIFY(!eng.hasUncaughtException()); QVERIFY(ret.isArray()); QStringList slist = qscriptvalue_cast<QStringList>(ret); - if (!qt_script_isJITEnabled()) { - QEXPECT_FAIL("eval", "QTBUG-17842: Missing line number in backtrace when function calls eval()", Continue); - QEXPECT_FAIL("eval in member", "QTBUG-17842: Missing line number in backtrace when function calls eval()", Continue); - } + QEXPECT_FAIL("eval", "QTBUG-17842: Missing line number in backtrace when function calls eval()", Continue); + QEXPECT_FAIL("eval in member", "QTBUG-17842: Missing line number in backtrace when function calls eval()", Continue); QCOMPARE(slist, expectedbacktrace); } |