diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-12-02 12:55:19 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-12-02 13:06:11 +0100 |
commit | 1ba57c41a9d71060ddc1aa515bccd57f2fab82e8 (patch) | |
tree | 3f62ff5db1aa56140493919dae70a95a8eddbe65 /src/qml/jsruntime | |
parent | 7cf80e6de060cb5d90179ef61745363ff3381941 (diff) |
Construct arguments for AOT-compiled functions before metaTypeFromJS
metaTypeFromJS expects to assign the value using regular operator=. That
destructs the old value and therefore the old value has to exist.
Change-Id: Ife443b184c30d658f42b65c6717e80685f6635d5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 581282c316..98a6d94ecc 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -470,11 +470,10 @@ ReturnedValue VME::exec(CppStackFrame *frame, ExecutionEngine *engine) const QMetaType argumentType = function->aotFunction->argumentTypes[i]; if (const qsizetype argumentSize = argumentType.sizeOf()) { Q_ALLOCA_VAR(void, argument, argumentSize); + argumentType.construct(argument); if (i < frame->originalArgumentsCount) { engine->metaTypeFromJS(frame->originalArguments[i], argumentType.id(), argument); - } else { - argumentType.construct(argument); } argumentPtrs[i] = argument; } else { |