gh-117376: Fix off-by-ones in conversion functions (GH-124301)

Fix off-by-ones in conversion function
This commit is contained in:
Ken Jin 2024-09-26 02:41:07 +08:00 committed by GitHub
parent c1600c78e4
commit 198756b0f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -3928,7 +3928,7 @@ dummy_func(
PyCFunctionFastWithKeywords cfunc =
(PyCFunctionFastWithKeywords)(void(*)(void))meth->ml_meth;
STACKREFS_TO_PYOBJECTS(args, nargs, args_o);
STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);
@ -4009,7 +4009,7 @@ dummy_func(
(PyCFunctionFast)(void(*)(void))meth->ml_meth;
int nargs = total_args - 1;
STACKREFS_TO_PYOBJECTS(args, nargs, args_o);
STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);

View File

@ -4596,7 +4596,7 @@
int nargs = total_args - 1;
PyCFunctionFastWithKeywords cfunc =
(PyCFunctionFastWithKeywords)(void(*)(void))meth->ml_meth;
STACKREFS_TO_PYOBJECTS(args, nargs, args_o);
STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable);
PyStackRef_CLOSE(self_or_null[0]);
@ -4713,7 +4713,7 @@
PyCFunctionFast cfunc =
(PyCFunctionFast)(void(*)(void))meth->ml_meth;
int nargs = total_args - 1;
STACKREFS_TO_PYOBJECTS(args, nargs, args_o);
STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable);
PyStackRef_CLOSE(self_or_null[0]);

View File

@ -2252,7 +2252,7 @@
PyCFunctionFast cfunc =
(PyCFunctionFast)(void(*)(void))meth->ml_meth;
int nargs = total_args - 1;
STACKREFS_TO_PYOBJECTS(args, nargs, args_o);
STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable);
PyStackRef_CLOSE(self_or_null[0]);
@ -2333,7 +2333,7 @@
int nargs = total_args - 1;
PyCFunctionFastWithKeywords cfunc =
(PyCFunctionFastWithKeywords)(void(*)(void))meth->ml_meth;
STACKREFS_TO_PYOBJECTS(args, nargs, args_o);
STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
PyStackRef_CLOSE(callable);
PyStackRef_CLOSE(self_or_null[0]);