diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index 072c0fb9cc..67d31b6c6c 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -78,8 +78,8 @@ public: // first nArguments names in internalClass are the actual arguments Heap::InternalClass *internalClass; - uint nFormals; int interpreterCallCount = 0; + quint16 nFormals; bool isEval = false; bool detectedInjectedParameters = false; diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index e91148f66c..c7eed14593 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -743,13 +743,17 @@ QString QQmlPropertyCache::signalParameterStringForJS(QV4::ExecutionEngine *engi const QSet &illegalNames = engine->illegalNames(); QString parameters; - for (int i = 0; i < parameterNameList.count(); ++i) { + const qsizetype count = parameterNameList.count(); + if (count > std::numeric_limits::max()) + *errorString = QCoreApplication::translate("QQmlRewrite", "Signal has an excessive number of parameters: %1").arg(count); + + for (qsizetype i = 0; i < count; ++i) { if (i > 0) parameters += QLatin1Char(','); const QByteArray ¶m = parameterNameList.at(i); - if (param.isEmpty()) + if (param.isEmpty()) { unnamedParameter = true; - else if (unnamedParameter) { + } else if (unnamedParameter) { if (errorString) *errorString = QCoreApplication::translate("QQmlRewrite", "Signal uses unnamed parameter followed by named parameter."); return QString();