aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index b68f9327d89..70c7d82b090 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -1714,11 +1714,10 @@ dummy_func(
}
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);
@@ -3235,7 +3234,10 @@ dummy_func(
/* Callable is not a normal Python function */
STACKREFS_TO_PYOBJECTS(args, total_args, args_o);
if (CONVERSION_FAILED(args_o)) {
- DECREF_INPUTS();
+ PyStackRef_CLOSE(callable);
+ for (int i = 0; i < total_args; i++) {
+ PyStackRef_CLOSE(args[i]);
+ }
ERROR_IF(true, error);
}
PyObject *res_o = PyObject_Vectorcall(