mirror of
https://github.com/python/cpython.git
synced 2025-11-26 21:33:10 +00:00
gh-117139: Replace _PyList_FromArraySteal with stack ref variant (#122830)
This replaces `_PyList_FromArraySteal` with `_PyList_FromStackRefSteal`. It's functionally equivalent, but takes a `_PyStackRef` array instead of an array of `PyObject` pointers. Co-authored-by: Ken Jin <kenjin@python.org>
This commit is contained in:
parent
736fe4d23e
commit
ab094d1b2b
6 changed files with 13 additions and 34 deletions
10
Python/executor_cases.c.h
generated
10
Python/executor_cases.c.h
generated
|
|
@ -1882,15 +1882,7 @@
|
|||
_PyStackRef list;
|
||||
oparg = CURRENT_OPARG();
|
||||
values = &stack_pointer[-oparg];
|
||||
STACKREFS_TO_PYOBJECTS(values, oparg, values_o);
|
||||
if (CONVERSION_FAILED(values_o)) {
|
||||
for (int _i = oparg; --_i >= 0;) {
|
||||
PyStackRef_CLOSE(values[_i]);
|
||||
}
|
||||
if (true) JUMP_TO_ERROR();
|
||||
}
|
||||
PyObject *list_o = _PyList_FromArraySteal(values_o, oparg);
|
||||
STACKREFS_TO_PYOBJECTS_CLEANUP(values_o);
|
||||
PyObject *list_o = _PyList_FromStackRefSteal(values, oparg);
|
||||
if (list_o == NULL) JUMP_TO_ERROR();
|
||||
list = PyStackRef_FromPyObjectSteal(list_o);
|
||||
stack_pointer[-oparg] = list;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue