aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsengine.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-05-08 11:38:14 +0200
committerUlf Hermann <ulf.hermann@qt.io>2023-05-09 21:28:06 +0200
commit406a9e1301e2597962ef0564348304be67d2c316 (patch)
tree40a2cfb1581dc7faf017e5e5598241298f2bd003 /src/qml/jsapi/qjsengine.cpp
parent1b89c1edcae68351632c2755e5408410c2ff98e3 (diff)
QML: Encode "missing" line number as negated address of stack frame
This way we can identify which entry in a stack frame to amend when processing an exception in generated code. However, negative line numbers are also used to signal the position of "Ret" instructions. Since you cannot throw an exception from a "Ret" instruction, those cannot collide, but we cannot qAbs() the line number anymore when saving it in the stack trace. We have to qAbs() it in all the places where it's read. Pick-to: 6.5 Fixes: QTBUG-112946 Change-Id: I24dc4008fb7eab38e4d24e70211c22e46f1b72a7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsengine.cpp')
-rw-r--r--src/qml/jsapi/qjsengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp
index eda1c4c931..eca6562b90 100644
--- a/src/qml/jsapi/qjsengine.cpp
+++ b/src/qml/jsapi/qjsengine.cpp
@@ -530,7 +530,7 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in
for (auto &&frame: trace)
exceptionStackTrace->push_back(QString::fromLatin1("%1:%2:%3:%4").arg(
frame.function,
- QString::number(frame.line),
+ QString::number(qAbs(frame.line)),
QString::number(frame.column),
frame.source)
);