aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontextwrapper.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-06 10:18:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-06 13:08:19 +0100
commit5de274605a19fe7d8cf989978d5959826e7970c7 (patch)
tree847899722e62e5ec9c45a621237074feb8527941 /src/qml/qml/qqmlcontextwrapper.cpp
parent1a38f519cbc0890d8f0163ab35c140592ab204ac (diff)
[new compiler] Fix incorrect accelerated lookups to id objects
When compiling JS code in the scope of a component, make sure to always set the id object mapping, even if it is empty. Otherwise the id objects from one scope might leak into another, leading to id object dependencies that are invalid. Change-Id: Ib2bca11203acd6924e8c74f9560a1ee3e00d7e39 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper.cpp')
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index 1660e3aeb1..e72e90296f 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -382,8 +382,10 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C
const quint32 *idObjectDependency = compiledFunction->qmlIdObjectDependencyTable();
const int idObjectDependencyCount = compiledFunction->nDependingIdObjects;
- for (int i = 0; i < idObjectDependencyCount; ++i, ++idObjectDependency)
+ for (int i = 0; i < idObjectDependencyCount; ++i, ++idObjectDependency) {
+ Q_ASSERT(int(*idObjectDependency) < qmlContext->idValueCount);
capture->captureProperty(&qmlContext->idValues[*idObjectDependency].bindings);
+ }
const quint32 *contextPropertyDependency = compiledFunction->qmlContextPropertiesDependencyTable();
const int contextPropertyDependencyCount = compiledFunction->nDependingContextProperties;