mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
gh-117139: Fix a few _PyStackRef related bugs (#122831)
`BUILD_SET` should use a borrow instead of a steal. The cleanup in `_DO_CALL` `CONVERSION_FAILED` was incorrect. Co-authored-by: Ken Jin <kenjin@python.org>
This commit is contained in:
parent
be90648fb2
commit
736fe4d23e
3 changed files with 14 additions and 16 deletions
5
Python/executor_cases.c.h
generated
5
Python/executor_cases.c.h
generated
|
|
@ -1957,11 +1957,10 @@
|
|||
}
|
||||
int err = 0;
|
||||
for (int i = 0; i < oparg; i++) {
|
||||
PyObject *item = PyStackRef_AsPyObjectSteal(values[i]);
|
||||
if (err == 0) {
|
||||
err = PySet_Add(set_o, item);
|
||||
err = PySet_Add(set_o, PyStackRef_AsPyObjectBorrow(values[i]));
|
||||
}
|
||||
Py_DECREF(item);
|
||||
PyStackRef_CLOSE(values[i]);
|
||||
}
|
||||
if (err != 0) {
|
||||
Py_DECREF(set_o);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue