diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-12-10 14:50:55 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-12-13 19:42:14 +0000 |
commit | 4ad8a0d1bc9f66babc363cf0eeb5559781e82ac0 (patch) | |
tree | 862255f8d4d50485a38b42ebb517f2ebd6db33f9 /src/qmlcompiler/qqmljsfunctioninitializer.cpp | |
parent | 1a5c61e7b1e61949d71d1a0ecc9a8d5d66bd1c03 (diff) |
qqmljstypepropagator: Use variant type for arguments of unknown type
Previously those function arguments would result in an invalid type
being used which lead to crashes when invoking methods using those
arguments.
Fixes: QTBUG-99027
Change-Id: I27e643f2512e1542d766b5fe98adfee043245c6f
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit e83fd85cce26823c6289a32fd5f7a0fa87639407)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp')
-rw-r--r-- | src/qmlcompiler/qqmljsfunctioninitializer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsfunctioninitializer.cpp b/src/qmlcompiler/qqmljsfunctioninitializer.cpp index 0139071cc0..8cd3bb3536 100644 --- a/src/qmlcompiler/qqmljsfunctioninitializer.cpp +++ b/src/qmlcompiler/qqmljsfunctioninitializer.cpp @@ -94,10 +94,12 @@ void QQmlJSFunctionInitializer::populateSignature( if (const auto type = m_typeResolver->typeFromAST(argument.typeAnnotation->type)) { function->argumentTypes.append(type); } else { + function->argumentTypes.append(m_typeResolver->varType()); signatureError(u"Cannot resolve the argument type %1."_qs .arg(argument.typeAnnotation->type->toString())); } } else { + function->argumentTypes.append(m_typeResolver->varType()); signatureError(u"Functions without type annotations won't be compiled"_qs); } } |