aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-05-20 15:54:14 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-05-26 10:03:17 +0200
commit7645c8e0f88a83d021f0a327617189b7772b14eb (patch)
treeaceb8b94aa6db63cd1688375b68a8eb9e0a5b19d /src/qml/jsruntime
parent512fde525ea5972bbae2796d6b2054fd370a5275 (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 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I3a87fc6f577807e2daf74eeacd2aab61f40aefc8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-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 4366a6932d..fd8a0bed5d 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -392,7 +392,7 @@ ReturnedValue QObjectWrapper::getQmlProperty(
if (hasProperty)
*hasProperty = true;
- if (property)
+ if (property && result != &local)
*property = result;
return getProperty(engine, object, result);