aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-05-20 15:54:14 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-06-02 08:14:23 +0000
commit208c98b7e97690179cb16b132a4bf26baa79e0d7 (patch)
tree5c642d09a8b27f99bf036ba658ae9402543ea3f8
parentabaa8cf657111c86f1db72dff65a0c85e158f7b1 (diff)
Don't return a pointer to a local in QObjectWrapper::getQmlProperty()
findProperty() can optionally create the property on the fly. We store the result on the stack. In that case we can figure out that the property exists, but we cannot return its value. This is OK, as we do the same in the default case below. Coverity-Id: 193545 Change-Id: I3a87fc6f577807e2daf74eeacd2aab61f40aefc8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7645c8e0f88a83d021f0a327617189b7772b14eb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 63b6435112..917c4d3cb5 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -384,7 +384,7 @@ ReturnedValue QObjectWrapper::getQmlProperty(QV4::ExecutionEngine *engine, QQmlC
if (hasProperty)
*hasProperty = true;
- if (property)
+ if (property && result != &local)
*property = result;
return getProperty(engine, object, result);