From 02c4c817fe1cfa4766c56759be99fb081382a586 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 29 Sep 2023 11:47:33 +0200 Subject: QtQml: Construct return type before metaCall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The metacall expects initialized memory. Let's give it what it wants. Fixes: QTBUG-117672 Change-Id: If139029ac4771ac919c5f09728633546e7bb9d1e Reviewed-by: Olivier De Cannière Reviewed-by: Fabian Kosmale --- src/qml/jsruntime/qv4jscall_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qml/jsruntime/qv4jscall_p.h') diff --git a/src/qml/jsruntime/qv4jscall_p.h b/src/qml/jsruntime/qv4jscall_p.h index f49b5a4a47..82a83fd06f 100644 --- a/src/qml/jsruntime/qv4jscall_p.h +++ b/src/qml/jsruntime/qv4jscall_p.h @@ -485,6 +485,8 @@ void coerceAndCall( } else if (returnType.sizeOf() > 0) { Q_ALLOCA_ASSIGN(void, transformedResult, returnType.sizeOf()); transformedArguments[0] = transformedResult; + if (returnType.flags() & QMetaType::NeedsConstruction) + returnType.construct(transformedResult); } else { transformedResult = transformedArguments[0] = &argc; // Some non-null marker value } -- cgit v1.2.3