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 13, 2023
1 parent 778ca94 commit 68077f1
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 @@ -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);
Expand Down Expand Up @@ -1967,7 +1967,7 @@ dummy_func(
jump = true;
}
else if (err == 0) {
DECREF_INPUTS();
Py_DECREF(cond);
}
else {
goto error;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
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 68077f1

Please sign in to comment.