diff --git a/Modules/clinic/_testclinic.c.h b/Modules/clinic/_testclinic.c.h index b2db377023f2e6..c6133a3a2e6410 100644 --- a/Modules/clinic/_testclinic.c.h +++ b/Modules/clinic/_testclinic.c.h @@ -3733,7 +3733,7 @@ _testclinic_TestClass_defclass_varpos(PyObject *self, PyTypeObject *cls, PyObjec .kwtuple = KWTUPLE, }; #undef KWTUPLE - PyObject *argsbuf[0]; + PyObject *argsbuf[1]; PyObject * const *fastargs; PyObject *__clinic_args = NULL; @@ -3809,4 +3809,4 @@ _testclinic_TestClass_defclass_posonly_varpos(PyObject *self, PyTypeObject *cls, return return_value; } -/*[clinic end generated code: output=fa10ab215bdd6259 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e4717fe7fdaf5cf3 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/libclinic/parse_args.py b/Tools/clinic/libclinic/parse_args.py index 650bed5f2391de..edf13e9f958421 100644 --- a/Tools/clinic/libclinic/parse_args.py +++ b/Tools/clinic/libclinic/parse_args.py @@ -657,7 +657,7 @@ def parse_general(self, clang: CLanguage) -> None: self.flags = "METH_FASTCALL|METH_KEYWORDS" self.parser_prototype = PARSER_PROTOTYPE_FASTCALL_KEYWORDS self.declarations = declare_parser(self.func, codegen=self.codegen) - self.declarations += "\nPyObject *argsbuf[%s];" % len(self.converters) + self.declarations += "\nPyObject *argsbuf[%s];" % (len(self.converters) or 1) if self.varpos: self.declarations += "\nPyObject * const *fastargs;" argsname = 'fastargs' @@ -675,7 +675,7 @@ def parse_general(self, clang: CLanguage) -> None: argsname = 'fastargs' argname_fmt = 'fastargs[%d]' self.declarations = declare_parser(self.func, codegen=self.codegen) - self.declarations += "\nPyObject *argsbuf[%s];" % len(self.converters) + self.declarations += "\nPyObject *argsbuf[%s];" % (len(self.converters) or 1) self.declarations += "\nPyObject * const *fastargs;" self.declarations += "\nPy_ssize_t nargs = PyTuple_GET_SIZE(args);" if has_optional_kw: