From 8bf5aae19b77b618f3f7a55a59e87c8a319475a8 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 16 Apr 2024 17:03:01 +0200 Subject: QtQml: Properly enforce signatures of AOT-compiled functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass the metatypes of the contained types rather than the stored types. [ChangeLog][QtQml][Important Behavior Changes] The AOT compiled code for type-annotated JavaScript functions does not let you pass or return values of the wrong type anymore. Fixes: QTBUG-119885 Change-Id: I685d398c0745d32a999a3abd76c622a2c0d6651f Reviewed-by: Olivier De Cannière Reviewed-by: Fabian Kosmale --- src/qml/qml/qqml.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/qml/qml/qqml.cpp') diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index ff419b0b34..eb716671b1 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -176,6 +176,22 @@ void QQmlPrivate::qmlRegistrationWarning( } } +QMetaType QQmlPrivate::compositeMetaType( + QV4::ExecutableCompilationUnit *unit, const QString &elementName) +{ + return QQmlTypePrivate::compositeQmlType( + unit->baseCompilationUnit(), unit->engine->typeLoader(), elementName) + .typeId(); +} + +QMetaType QQmlPrivate::compositeListMetaType( + QV4::ExecutableCompilationUnit *unit, const QString &elementName) +{ + return QQmlTypePrivate::compositeQmlType( + unit->baseCompilationUnit(), unit->engine->typeLoader(), elementName) + .qListTypeId(); +} + int qmlRegisterUncreatableMetaObject(const QMetaObject &staticMetaObject, const char *uri, int versionMajor, int versionMinor, const char *qmlName, -- cgit v1.2.3