aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-03-23 10:04:22 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-03-25 07:13:17 +0000
commit56c4298cdced135bae65cba617dbf6f962c5ceed (patch)
tree0e9b91c649c38ae099b738a505c947e57d79bd53 /src/qml/jsruntime
parent0b6d10cd337c09c4581f89db4ae8cb636ff84fe7 (diff)
QmlCompiler: Fix a number of warts regarding type lookup
There was a condition missing in qqml.cpp making most type lookups crash right away. Furthermore, we need to generate code for type lookups we do need. Fixes: QTBUG-102019 Change-Id: I34e9de7686528b39a35e59c616e4e28b32a6e031 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5901fba81195ed725ffd7ad6c278e44f41b6df6f)
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4lookup_p.h2
-rw-r--r--src/qml/jsruntime/qv4qmlcontext.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h
index d964fadd18..cd7c5e10d9 100644
--- a/src/qml/jsruntime/qv4lookup_p.h
+++ b/src/qml/jsruntime/qv4lookup_p.h
@@ -167,7 +167,7 @@ struct Q_QML_PRIVATE_EXPORT Lookup {
ReturnedValue (*getterTrampoline)(Lookup *l, ExecutionEngine *engine);
} qmlContextGlobalLookup;
struct {
- Heap::Object *qmlTypeWrapper;
+ Heap::Base *qmlTypeWrapper;
quintptr unused2;
} qmlTypeLookup;
struct {
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp
index f7a5f897c8..edcccdd1b8 100644
--- a/src/qml/jsruntime/qv4qmlcontext.cpp
+++ b/src/qml/jsruntime/qv4qmlcontext.cpp
@@ -268,7 +268,7 @@ ReturnedValue QQmlContextWrapper::getPropertyAndBase(const QQmlContextWrapper *r
result = QQmlTypeWrapper::create(v4, scopeObject, context->imports(), r.importNamespace);
}
if (lookup) {
- lookup->qmlTypeLookup.qmlTypeWrapper = static_cast<Heap::Object*>(result->heapObject());
+ lookup->qmlTypeLookup.qmlTypeWrapper = result->heapObject();
lookup->qmlContextPropertyGetter = QQmlContextWrapper::lookupType;
}
return result->asReturnedValue();
@@ -718,7 +718,7 @@ ReturnedValue QQmlContextWrapper::lookupType(Lookup *l, ExecutionEngine *engine,
if (scopeObject && QQmlData::wasDeleted(scopeObject))
return QV4::Encode::undefined();
- Heap::Object *heapObject = l->qmlTypeLookup.qmlTypeWrapper;
+ Heap::Base *heapObject = l->qmlTypeLookup.qmlTypeWrapper;
if (static_cast<Heap::QQmlTypeWrapper *>(heapObject)->object != scopeObject) {
l->qmlTypeLookup.qmlTypeWrapper = nullptr;
l->qmlContextPropertyGetter = QQmlContextWrapper::resolveQmlContextPropertyLookupGetter;