diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-05-23 12:55:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-05-23 11:06:34 +0000 |
commit | 60176efa7843fda048b2eb5d347fab0dd991e26d (patch) | |
tree | 4903b088cdaec40fdec6e040d4fdd96037340eda /tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml | |
parent | eaec83583fff3e3bf431f6179936b84f4acca553 (diff) |
Fix crash when incubating objects with non-existent initial properties
When incubation is triggered from C++ and reaches the state of setting
the initial properties (as supplied to incubateObject), we'd set
engine->currentStackFrame to a CppStackFrame that provides access to the
correct QML context. As we're not called from the interpreter, the
v4Function pointer would be a null pointer. If during the initial
property setting an exception is thrown (due to non-existent property
access) and a back-trace is created, we'd end up dereferencing
v4Function.
Change-Id: I7f6b0ba7893bfb4186f55d4c213b4bb602d29aa0
Task-number: QTBUG-68416
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml')
-rw-r--r-- | tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml b/tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml new file mode 100644 index 0000000000..ef89e46088 --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/nonExistentInitialProperty.qml @@ -0,0 +1,9 @@ +import QtQml 2.0 +QtObject { + property Component factory: Qt.createComponent(Qt.resolvedUrl("InitialPropertyTest.qml"), Component.PreferSynchronous) + property var incubator + function startIncubation() + { + incubator = factory.incubateObject(null, { ok: true, nonExistent: 42 }, Qt.Asynchronous) + } +} |