diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-05-20 15:54:14 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-06-02 08:15:05 +0000 |
commit | 4907c631941d4f60c77122faf79e3af2527eb7c6 (patch) | |
tree | 23247c10e3f5524ffa1575835b5426039dcbdee9 | |
parent | 73becff81b714e6f3e19392ff32ec36b60bcb38c (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.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 66b79aa0e8..9f11166a84 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -382,7 +382,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); |