diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-04-16 17:03:01 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-04-26 12:18:15 +0000 |
| commit | 8bf5aae19b77b618f3f7a55a59e87c8a319475a8 (patch) | |
| tree | d331328f478ac13593524eaaeb3a874691ccadd2 /src/qml/jsruntime/qv4functionobject.cpp | |
| parent | 23fc22e16022e355f2a1aff8705c09b807fbe024 (diff) | |
QtQml: Properly enforce signatures of AOT-compiled functions
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 <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index b5a3934528..ab6a34435f 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -539,13 +539,13 @@ ReturnedValue ArrowFunction::virtualCall(const QV4::FunctionObject *fo, const Va switch (function->kind) { case Function::AotCompiled: return QV4::convertAndCall( - fo->engine(), function->aotCompiledFunction, thisObject, argv, argc, + fo->engine(), &function->aotCompiledFunction, thisObject, argv, argc, [fo](QObject *thisObject, void **a, const QMetaType *types, int argc) { ArrowFunction::virtualCallWithMetaTypes(fo, thisObject, a, types, argc); }); case Function::JsTyped: return QV4::coerceAndCall( - fo->engine(), function->jsTypedFunction, function->compiledFunction, argv, argc, + fo->engine(), &function->jsTypedFunction, function->compiledFunction, argv, argc, [fo, thisObject](const Value *argv, int argc) { return qfoDoCall(fo, thisObject, argv, argc); }); |
