Skip to content

Commit

Permalink
Whoops, cannot use DECREF_INPUTS() in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Mar 4, 2023
1 parent 2b45efe commit 394f2e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,7 @@ dummy_func(
else {
err = PyObject_IsTrue(cond);
if (err > 0) {
DECREF_INPUTS();
Py_DECREF(cond);
}
else if (err == 0) {
JUMPBY(oparg);
Expand Down Expand Up @@ -1978,7 +1978,7 @@ dummy_func(
jump = true;
}
else if (err == 0) {
DECREF_INPUTS();
Py_DECREF(cond);
}
else {
goto error;
Expand Down Expand Up @@ -2111,7 +2111,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);
Expand All @@ -2134,7 +2134,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);
Expand All @@ -2157,7 +2157,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);
Expand Down
5 changes: 5 additions & 0 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 394f2e0

Please sign in to comment.