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:14:23 +0000 |
commit | 208c98b7e97690179cb16b132a4bf26baa79e0d7 (patch) | |
tree | 5c642d09a8b27f99bf036ba658ae9402543ea3f8 /src | |
parent | abaa8cf657111c86f1db72dff65a0c85e158f7b1 (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>
Diffstat (limited to 'src')
-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 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); |