aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-01-25 17:27:56 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-01-26 08:46:48 +0100
commitd77c16639ce68d95a22640d8fb7cc9b846a1ed05 (patch)
tree3328cacafd5c877b742f10afded55dc99f8c6954 /src/qml
parentc0a582ed1cfa349fd2b32c30be5edb1fbbf2168a (diff)
Allow AOT compiled functions to set the instruction pointer
This way we get correct line numbers in error messages. Change-Id: Ieb642523f74adf73955e78cdfb8cb2faee40b321 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/qml/qqml.cpp5
-rw-r--r--src/qml/qml/qqmlprivate.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp
index 77c5226a97..d4eeff90a2 100644
--- a/src/qml/qml/qqml.cpp
+++ b/src/qml/qml/qqml.cpp
@@ -601,4 +601,9 @@ QJSValue QQmlPrivate::AOTCompiledContext::jsMetaType(int index) const
compilationUnit->runtimeClasses[index]->asReturnedValue());
}
+void QQmlPrivate::AOTCompiledContext::setInstructionPointer(int offset) const
+{
+ engine->handle()->currentStackFrame->instructionPointer = offset;
+}
+
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h
index 608a0f0188..fb2d80b3df 100644
--- a/src/qml/qml/qqmlprivate.h
+++ b/src/qml/qml/qqmlprivate.h
@@ -602,13 +602,14 @@ namespace QQmlPrivate
QVector<int> *qmlTypeIds;
};
- struct AOTCompiledContext {
+ struct Q_QML_EXPORT AOTCompiledContext {
QQmlContext *qmlContext;
QObject *qmlScopeObject;
QJSEngine *engine;
QV4::CompiledData::CompilationUnit *compilationUnit;
- QJSValue Q_QML_EXPORT jsMetaType(int index) const;
+ QJSValue jsMetaType(int index) const;
+ void setInstructionPointer(int offset) const;
};
struct AOTCompiledFunction {