https://github.com/python/cpython/commit/198756b0f653e9f487076df2c6f943e374def6cb
commit: 198756b0f653e9f487076df2c6f943e374def6cb
branch: main
author: Ken Jin <[email protected]>
committer: Fidget-Spinner <[email protected]>
date: 2024-09-26T02:41:07+08:00
summary:
gh-117376: Fix off-by-ones in conversion functions (GH-124301)
Fix off-by-ones in conversion function
files:
M Python/bytecodes.c
M Python/executor_cases.c.h
M Python/generated_cases.c.h
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index bf8f6af83fc56e..0fd396f1319e78 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -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);
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 7285acec0bacaf..7a9c6ab89c38cc 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -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]);
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 58792a2101ab28..1201fe82efb919 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -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]);
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]