diff options
| author | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-06-13 11:01:29 +0200 |
|---|---|---|
| committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-06-17 17:35:44 +0200 |
| commit | 2e8acbdf16bd9948c5e433d56024d93ac051baca (patch) | |
| tree | 9bbeda115d3c05b234e0d9e73c4686a27d999eb1 /src/qml/jsruntime/qv4object.cpp | |
| parent | 29361b881592546b259b21af43c8459f692f7a3c (diff) | |
Fix Proxy / QV4::Lookup interaction
If an object is proxied, we can't use the optimized getters for the
lookup, as those would bypass the custom proxy logic.
Fix this by always using the fallback code path when encountering a
Proxy object.
Pick-to: 6.8 6.7 6.5
Fixes: QTBUG-112320
Change-Id: Idd8d4f2cd0134ada010448d470cfc68e765ef125
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 766d0e1994..4c265a6b23 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -747,6 +747,12 @@ ReturnedValue Object::virtualResolveLookupGetter(const Object *object, Execution Heap::Object *obj = object->d(); PropertyKey name = engine->identifierTable->asPropertyKey(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[lookup->nameIndex]); + if (object->as<QV4::ProxyObject>()) { + // proxies invalidate assumptions that we normally maek in lookups + // so we always need to use the fallback path + lookup->getter = Lookup::getterFallback; + return lookup->getter(lookup, engine, *object); + } if (name.isArrayIndex()) { lookup->indexedLookup.index = name.asArrayIndex(); lookup->getter = Lookup::getterIndexed; |
