mirror of
https://github.com/python/cpython.git
synced 2026-04-15 00:00:57 +00:00
gh-145866: Convert SET_UPDATE to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-145979)
This commit is contained in:
parent
982459132b
commit
0d37e423d5
10 changed files with 1030 additions and 981 deletions
|
|
@ -2181,13 +2181,18 @@ dummy_func(
|
|||
PyStackRef_CLOSE(iterable_st);
|
||||
}
|
||||
|
||||
inst(SET_UPDATE, (set, unused[oparg-1], iterable -- set, unused[oparg-1])) {
|
||||
op(_SET_UPDATE, (set, unused[oparg-1], iterable -- set, unused[oparg-1], i)) {
|
||||
int err = _PySet_Update(PyStackRef_AsPyObjectBorrow(set),
|
||||
PyStackRef_AsPyObjectBorrow(iterable));
|
||||
PyStackRef_CLOSE(iterable);
|
||||
ERROR_IF(err < 0);
|
||||
if (err < 0) {
|
||||
ERROR_NO_POP();
|
||||
}
|
||||
i = iterable;
|
||||
DEAD(iterable);
|
||||
}
|
||||
|
||||
macro(SET_UPDATE) = _SET_UPDATE + POP_TOP;
|
||||
|
||||
inst(BUILD_SET, (values[oparg] -- set)) {
|
||||
PyObject *set_o = PySet_New(NULL);
|
||||
if (set_o == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue