diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 1c3baef7c5b17f..258bcb93a19dbc 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -1938,7 +1938,7 @@ dummy_func( else { err = PyObject_IsTrue(cond); if (err > 0) { - DECREF_INPUTS(); + Py_DECREF(cond); } else if (err == 0) { JUMPBY(oparg); @@ -1967,7 +1967,7 @@ dummy_func( jump = true; } else if (err == 0) { - DECREF_INPUTS(); + Py_DECREF(cond); } else { goto error; @@ -2100,7 +2100,7 @@ dummy_func( } /* iterator ended normally */ assert(next_instr[INLINE_CACHE_ENTRIES_FOR_ITER + oparg].op.code == END_FOR); - DECREF_INPUTS(); + Py_DECREF(iter); STACK_SHRINK(1); /* Jump forward oparg, then skip following END_FOR instruction */ JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1); @@ -2123,7 +2123,7 @@ dummy_func( it->it_seq = NULL; Py_DECREF(seq); } - DECREF_INPUTS(); + Py_DECREF(iter); STACK_SHRINK(1); /* Jump forward oparg, then skip following END_FOR instruction */ JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1); @@ -2146,7 +2146,7 @@ dummy_func( it->it_seq = NULL; Py_DECREF(seq); } - DECREF_INPUTS(); + Py_DECREF(iter); STACK_SHRINK(1); /* Jump forward oparg, then skip following END_FOR instruction */ JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1); diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 7bd0b3826174c8..a64b930c8b9e3e 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -2463,6 +2463,7 @@ else { err = PyObject_IsTrue(cond); if (err > 0) { + Py_DECREF(cond); } else if (err == 0) { JUMPBY(oparg); @@ -2495,6 +2496,7 @@ jump = true; } else if (err == 0) { + Py_DECREF(cond); } else { goto error; @@ -2659,6 +2661,7 @@ } /* iterator ended normally */ assert(next_instr[INLINE_CACHE_ENTRIES_FOR_ITER + oparg].op.code == END_FOR); + Py_DECREF(iter); STACK_SHRINK(1); /* Jump forward oparg, then skip following END_FOR instruction */ JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1); @@ -2687,6 +2690,7 @@ it->it_seq = NULL; Py_DECREF(seq); } + Py_DECREF(iter); STACK_SHRINK(1); /* Jump forward oparg, then skip following END_FOR instruction */ JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1); @@ -2715,6 +2719,7 @@ it->it_seq = NULL; Py_DECREF(seq); } + Py_DECREF(iter); STACK_SHRINK(1); /* Jump forward oparg, then skip following END_FOR instruction */ JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1);