mirror of
https://github.com/python/cpython.git
synced 2026-04-15 08:11:10 +00:00
gh-145866: Convert LIST_EXTEND to leave its inputs on the stack to be cleaned up by _POP_TOP be cleaned up by _POP_TOP (GH-146383)
This commit is contained in:
parent
1417737810
commit
a492d9ff74
10 changed files with 1171 additions and 1140 deletions
|
|
@ -2285,7 +2285,7 @@ dummy_func(
|
|||
list = PyStackRef_FromPyObjectStealMortal(list_o);
|
||||
}
|
||||
|
||||
inst(LIST_EXTEND, (list_st, unused[oparg-1], iterable_st -- list_st, unused[oparg-1])) {
|
||||
op(_LIST_EXTEND, (list_st, unused[oparg-1], iterable_st -- list_st, unused[oparg-1], i)) {
|
||||
PyObject *list = PyStackRef_AsPyObjectBorrow(list_st);
|
||||
PyObject *iterable = PyStackRef_AsPyObjectBorrow(iterable_st);
|
||||
|
||||
|
|
@ -2300,13 +2300,15 @@ dummy_func(
|
|||
"Value after * must be an iterable, not %.200s",
|
||||
Py_TYPE(iterable)->tp_name);
|
||||
}
|
||||
PyStackRef_CLOSE(iterable_st);
|
||||
ERROR_IF(true);
|
||||
ERROR_NO_POP();
|
||||
}
|
||||
assert(Py_IsNone(none_val));
|
||||
PyStackRef_CLOSE(iterable_st);
|
||||
i = iterable_st;
|
||||
DEAD(iterable_st);
|
||||
}
|
||||
|
||||
macro(LIST_EXTEND) = _LIST_EXTEND + POP_TOP;
|
||||
|
||||
op(_SET_UPDATE, (set, unused[oparg-1], iterable -- set, unused[oparg-1], i)) {
|
||||
int err = _PySet_Update(PyStackRef_AsPyObjectBorrow(set),
|
||||
PyStackRef_AsPyObjectBorrow(iterable));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue