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);