diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-17 07:19:02 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-18 19:04:47 (GMT) |
commit | 93f017401ce8bb73415f88955e928a90c6759fc0 (patch) | |
tree | 6bf64b8b1db2382452890204db2b86ed1f1ae80c /src/script | |
parent | 91cb5464a35d2f461644677973ffdcc91985e7fd (diff) | |
download | Qt-93f017401ce8bb73415f88955e928a90c6759fc0.zip Qt-93f017401ce8bb73415f88955e928a90c6759fc0.tar.gz Qt-93f017401ce8bb73415f88955e928a90c6759fc0.tar.bz2 |
Fix the line numbers on the backtrace
The returnPC points to the opcode after the call, but we want the opcode
right before to compute the line number.
Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/qscriptcontextinfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp index a305116..04c26e2 100644 --- a/src/script/api/qscriptcontextinfo.cpp +++ b/src/script/api/qscriptcontextinfo.cpp @@ -172,7 +172,7 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte JSC::CodeBlock *codeBlock = frame->codeBlock(); if (returnPC && codeBlock) { lineNumber = codeBlock->lineNumberForBytecodeOffset(const_cast<JSC::ExecState *>(frame), - returnPC - codeBlock->instructions().begin()); + returnPC - codeBlock->instructions().begin() -1); } } } |