mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
14
Python/generated_cases.c.h
generated
14
Python/generated_cases.c.h
generated
|
@ -631,19 +631,7 @@
|
|||
_PyStackRef *values;
|
||||
_PyStackRef list;
|
||||
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) {
|
||||
stack_pointer += -oparg;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
goto 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) {
|
||||
stack_pointer += -oparg;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue