diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-09-14 14:54:42 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-09-19 09:44:33 +0000 |
commit | 042aa2eb0e55616fc754d0d71246efb531ca6dfe (patch) | |
tree | f48118a1f8564b4c4cbadc0ebf291d56d59dbb70 /src/qml/jsruntime/qv4jscall_p.h | |
parent | b7ddcdad876cf0a46aa14a0f78ee8b3e4f685c19 (diff) |
Change CallData::argc to be a QV4::Value
Instead of mimicking a Value. This makes sure that argc now stays
correct even when anything on Value changes.
Most of the change is mechanical: replace callData->argc by
callData->argc().
Change-Id: I521831ae1ffb3966bad6589c18d7a373e13439d7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4jscall_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4jscall_p.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4jscall_p.h b/src/qml/jsruntime/qv4jscall_p.h index 78201a0ba8..8fd6119102 100644 --- a/src/qml/jsruntime/qv4jscall_p.h +++ b/src/qml/jsruntime/qv4jscall_p.h @@ -65,23 +65,20 @@ struct JSCall { { int size = int(offsetof(QV4::CallData, args)/sizeof(QV4::Value)) + qMax(argc , int(QV4::Global::ReservedArgumentCount)); ptr = reinterpret_cast<CallData *>(scope.alloc(size)); - ptr->tag = quint32(QV4::Value::ValueTypeInternal::Integer); - ptr->argc = argc; + ptr->setArgc(argc); } JSCall(const Scope &scope, const FunctionObject *function, int argc = 0) { int size = int(offsetof(QV4::CallData, args)/sizeof(QV4::Value)) + qMax(argc , int(QV4::Global::ReservedArgumentCount)); ptr = reinterpret_cast<CallData *>(scope.alloc(size)); - ptr->tag = quint32(QV4::Value::ValueTypeInternal::Integer); - ptr->argc = argc; + ptr->setArgc(argc); ptr->function = *function; } JSCall(const Scope &scope, Heap::FunctionObject *function, int argc = 0) { int size = int(offsetof(QV4::CallData, args)/sizeof(QV4::Value)) + qMax(argc , int(QV4::Global::ReservedArgumentCount)); ptr = reinterpret_cast<CallData *>(scope.alloc(size)); - ptr->tag = quint32(QV4::Value::ValueTypeInternal::Integer); - ptr->argc = argc; + ptr->setArgc(argc); ptr->function = function; } |