aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-07-19 14:02:06 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-07-21 10:31:41 +0200
commitbc217ec9711af8da4d6617899c705498b56dc3b8 (patch)
treea019167284f5ccef933939a79e20309be004a4a0 /sources
parent525aa59e3871dccc0ffe6b1cb6441605e3635132 (diff)
shiboken6: Fix crashes when insufficient arguments are given
Checks for the number of arguments were not generated in some cases. Change-Id: If414cdd2eb4190966e847232128600d61a4769f6 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 947a7f5f5d55b6f72b449578d905e9a4b5feb6ea)
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index f299ba428..9303caacf 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -2818,7 +2818,7 @@ void CppGenerator::writeOverloadedFunctionDecisorEngine(QTextStream &s, const Ov
if (isVarargs)
--numArgs;
typeChecks.prepend(QString::fromLatin1("numArgs %1 %2").arg(isVarargs ? QLatin1String(">=") : QLatin1String("==")).arg(numArgs));
- } else if (sequenceArgCount > 1) {
+ } else if (usePyArgs && sequenceArgCount > 0) {
typeChecks.prepend(QString::fromLatin1("numArgs >= %1").arg(startArg + sequenceArgCount));
} else if (refFunc->isOperatorOverload() && !refFunc->isCallOperator()) {
typeChecks.prepend(QString::fromLatin1("%1isReverse").arg(refFunc->isReverseOperator() ? QString() : QLatin1String("!")));