summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authormpage <mpage@cs.stanford.edu>2024-10-21 18:08:13 (GMT)
committerGitHub <noreply@github.com>2024-10-21 18:08:13 (GMT)
commitde5a6c7c7d00ac37d66cba9849202b374e9cdfb7 (patch)
treea3c4f9f8c8e42f2b2fd062e7a8cdb94671c09b9a /Python/bytecodes.c
parent695814c6e97aad0ae2b116cedca3e77d25d5b968 (diff)
downloadcpython-de5a6c7c7d00ac37d66cba9849202b374e9cdfb7.zip
cpython-de5a6c7c7d00ac37d66cba9849202b374e9cdfb7.tar.gz
cpython-de5a6c7c7d00ac37d66cba9849202b374e9cdfb7.tar.bz2
gh-121459: Fix a couple of uses of `PyStackRef_FromPyObjectSteal` (#125711)
* Fix usage of PyStackRef_FromPyObjectSteal in CALL_TUPLE_1 This was missed in gh-124894 * Fix usage of PyStackRef_FromPyObjectSteal in _CALL_STR_1 This was missed in gh-124894 * Regenerate code
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index c59a35c..62e9b5d 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -3629,11 +3629,12 @@ dummy_func(
DEOPT_IF(!PyStackRef_IsNull(null));
DEOPT_IF(callable_o != (PyObject *)&PyUnicode_Type);
STAT_INC(CALL, hit);
- res = PyStackRef_FromPyObjectSteal(PyObject_Str(arg_o));
+ PyObject *res_o = PyObject_Str(arg_o);
DEAD(null);
DEAD(callable);
PyStackRef_CLOSE(arg);
- ERROR_IF(PyStackRef_IsNull(res), error);
+ ERROR_IF(res_o == NULL, error);
+ res = PyStackRef_FromPyObjectSteal(res_o);
}
macro(CALL_STR_1) =
@@ -3650,11 +3651,12 @@ dummy_func(
DEOPT_IF(!PyStackRef_IsNull(null));
DEOPT_IF(callable_o != (PyObject *)&PyTuple_Type);
STAT_INC(CALL, hit);
- res = PyStackRef_FromPyObjectSteal(PySequence_Tuple(arg_o));
+ PyObject *res_o = PySequence_Tuple(arg_o);
DEAD(null);
DEAD(callable);
PyStackRef_CLOSE(arg);
- ERROR_IF(PyStackRef_IsNull(res), error);
+ ERROR_IF(res_o == NULL, error);
+ res = PyStackRef_FromPyObjectSteal(res_o);
}
macro(CALL_TUPLE_1) =