aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4stackframe_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-06-15 09:38:17 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-06-15 14:03:48 +0200
commit31ab6b81060abb0db0a68c88c61ea93c7d6bdc60 (patch)
tree4bbf8f7d7ab63348417bb9faae4530288f3f482c /src/qml/jsruntime/qv4stackframe_p.h
parent719e7daab06d10c9cec0059d73096435a1589e00 (diff)
Allow AOT functions to signal an undefined result via the context
undefined as value returned from bindings has the special meaning of resetting the binding. As AOT-compiled functions return the actual type of the binding rather than a QV4::Value, we cannot always encode undefined. Therefore, add a flag that tells us whether the result was supposed to be undefined. Pick-to: 6.2 Change-Id: Iac2298869dde80f6d889240dd8200b2ad83e5dc5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4stackframe_p.h')
-rw-r--r--src/qml/jsruntime/qv4stackframe_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4stackframe_p.h b/src/qml/jsruntime/qv4stackframe_p.h
index 1439e9f677..9a121b48cd 100644
--- a/src/qml/jsruntime/qv4stackframe_p.h
+++ b/src/qml/jsruntime/qv4stackframe_p.h
@@ -90,6 +90,7 @@ struct Q_QML_PRIVATE_EXPORT CppStackFrameBase
QObject *thisObject;
const QMetaType *metaTypes;
void **returnAndArgs;
+ bool returnValueIsUndefined;
};
};
@@ -163,11 +164,15 @@ struct Q_QML_PRIVATE_EXPORT MetaTypesStackFrame : public CppStackFrame
CppStackFrameBase::context = context;
CppStackFrameBase::metaTypes = metaTypes;
CppStackFrameBase::returnAndArgs = returnAndArgs;
+ CppStackFrameBase::returnValueIsUndefined = false;
}
QMetaType returnType() const { return metaTypes[0]; }
void *returnValue() const { return returnAndArgs[0]; }
+ bool isReturnValueUndefined() const { return CppStackFrameBase::returnValueIsUndefined; }
+ void setReturnValueUndefined() { CppStackFrameBase::returnValueIsUndefined = true; }
+
const QMetaType *argTypes() const { return metaTypes + 1; }
void **argv() const { return returnAndArgs + 1; }