From 3ea55bf398412d373daab9c92b1498f45de70e96 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 7 Nov 2023 15:16:32 +0100 Subject: QtQml: Fix some problems with deep aliases We cannot get the property cache for an inline component the usual way during type compilation. We have to ask the compilation unit for it. Guard against still not being able to retrieve the property cache for any reason. Abort the compilation rather than crashing. Also, unify the setting of property attributes. Those should really work the same way everywhere. Finally, disallow writing aliases to value type properties where the property holding the value type itself is not writable. Pick-to: 6.6 6.5 6.2 Task-number: QTBUG-115579 Change-Id: I029eb56a9a390085d0c696a787a64c48acf0d620 Reviewed-by: Fabian Kosmale --- src/qml/jsruntime/qv4executablecompilationunit.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/qml/jsruntime/qv4executablecompilationunit.cpp') diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index e71568b2d8..c0c5f341e5 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -501,6 +501,15 @@ int ExecutableCompilationUnit::totalObjectCount() const { return inlineComponentData[*icRootName].totalObjectCount; } +ResolvedTypeReference *ExecutableCompilationUnit::resolvedType(QMetaType type) const +{ + for (ResolvedTypeReference *ref : std::as_const(resolvedTypes)) { + if (ref->type().typeId() == type) + return ref; + } + return nullptr; +} + int ExecutableCompilationUnit::totalParserStatusCount() const { if (!icRootName) return m_totalParserStatusCount; -- cgit v1.2.3