From 042aa2eb0e55616fc754d0d71246efb531ca6dfe Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 14 Sep 2017 14:54:42 +0200 Subject: 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 --- src/qml/qml/qqmldelayedcallqueue.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/qml/qml/qqmldelayedcallqueue.cpp') diff --git a/src/qml/qml/qqmldelayedcallqueue.cpp b/src/qml/qml/qqmldelayedcallqueue.cpp index 1537657e0d..738f87247f 100644 --- a/src/qml/qml/qqmldelayedcallqueue.cpp +++ b/src/qml/qml/qqmldelayedcallqueue.cpp @@ -109,7 +109,7 @@ void QQmlDelayedCallQueue::init(QV4::ExecutionEngine* engine) QV4::ReturnedValue QQmlDelayedCallQueue::addUniquelyAndExecuteLater(const QV4::BuiltinFunction *b, QV4::CallData *callData) { QV4::Scope scope(b); - if (callData->argc == 0) + if (callData->argc() == 0) THROW_GENERIC_ERROR("Qt.callLater: no arguments given"); const QV4::FunctionObject *func = callData->args[0].as(); @@ -176,17 +176,16 @@ QV4::ReturnedValue QQmlDelayedCallQueue::addUniquelyAndExecuteLater(const QV4::B void QQmlDelayedCallQueue::storeAnyArguments(DelayedFunctionCall &dfc, const QV4::CallData *callData, int offset, QV4::ExecutionEngine *engine) { - const int length = callData->argc - offset; + const int length = callData->argc() - offset; if (length == 0) { dfc.m_args.clear(); return; } QV4::Scope scope(engine); QV4::ScopedArrayObject array(scope, engine->newArrayObject(length)); - int i = 0; - for (int j = offset; j < callData->argc; ++i, ++j) { + uint i = 0; + for (int j = offset, ej = callData->argc(); j < ej; ++i, ++j) array->putIndexed(i, callData->args[j]); - } dfc.m_args.set(engine, array); } -- cgit v1.2.3