Skip to content

Commit de5a6c7

Browse files
authored
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
1 parent 695814c commit de5a6c7

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

Python/bytecodes.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -3629,11 +3629,12 @@ dummy_func(
36293629
DEOPT_IF(!PyStackRef_IsNull(null));
36303630
DEOPT_IF(callable_o != (PyObject *)&PyUnicode_Type);
36313631
STAT_INC(CALL, hit);
3632-
res = PyStackRef_FromPyObjectSteal(PyObject_Str(arg_o));
3632+
PyObject *res_o = PyObject_Str(arg_o);
36333633
DEAD(null);
36343634
DEAD(callable);
36353635
PyStackRef_CLOSE(arg);
3636-
ERROR_IF(PyStackRef_IsNull(res), error);
3636+
ERROR_IF(res_o == NULL, error);
3637+
res = PyStackRef_FromPyObjectSteal(res_o);
36373638
}
36383639

36393640
macro(CALL_STR_1) =
@@ -3650,11 +3651,12 @@ dummy_func(
36503651
DEOPT_IF(!PyStackRef_IsNull(null));
36513652
DEOPT_IF(callable_o != (PyObject *)&PyTuple_Type);
36523653
STAT_INC(CALL, hit);
3653-
res = PyStackRef_FromPyObjectSteal(PySequence_Tuple(arg_o));
3654+
PyObject *res_o = PySequence_Tuple(arg_o);
36543655
DEAD(null);
36553656
DEAD(callable);
36563657
PyStackRef_CLOSE(arg);
3657-
ERROR_IF(PyStackRef_IsNull(res), error);
3658+
ERROR_IF(res_o == NULL, error);
3659+
res = PyStackRef_FromPyObjectSteal(res_o);
36583660
}
36593661

36603662
macro(CALL_TUPLE_1) =

Python/executor_cases.c.h

+6-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

+6-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)