Skip to content

Commit 68077f1

Browse files
committed
Whoops, cannot use DECREF_INPUTS() in some cases
1 parent 778ca94 commit 68077f1

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Python/bytecodes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,7 @@ dummy_func(
19381938
else {
19391939
err = PyObject_IsTrue(cond);
19401940
if (err > 0) {
1941-
DECREF_INPUTS();
1941+
Py_DECREF(cond);
19421942
}
19431943
else if (err == 0) {
19441944
JUMPBY(oparg);
@@ -1967,7 +1967,7 @@ dummy_func(
19671967
jump = true;
19681968
}
19691969
else if (err == 0) {
1970-
DECREF_INPUTS();
1970+
Py_DECREF(cond);
19711971
}
19721972
else {
19731973
goto error;
@@ -2100,7 +2100,7 @@ dummy_func(
21002100
}
21012101
/* iterator ended normally */
21022102
assert(next_instr[INLINE_CACHE_ENTRIES_FOR_ITER + oparg].op.code == END_FOR);
2103-
DECREF_INPUTS();
2103+
Py_DECREF(iter);
21042104
STACK_SHRINK(1);
21052105
/* Jump forward oparg, then skip following END_FOR instruction */
21062106
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1);
@@ -2123,7 +2123,7 @@ dummy_func(
21232123
it->it_seq = NULL;
21242124
Py_DECREF(seq);
21252125
}
2126-
DECREF_INPUTS();
2126+
Py_DECREF(iter);
21272127
STACK_SHRINK(1);
21282128
/* Jump forward oparg, then skip following END_FOR instruction */
21292129
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1);
@@ -2146,7 +2146,7 @@ dummy_func(
21462146
it->it_seq = NULL;
21472147
Py_DECREF(seq);
21482148
}
2149-
DECREF_INPUTS();
2149+
Py_DECREF(iter);
21502150
STACK_SHRINK(1);
21512151
/* Jump forward oparg, then skip following END_FOR instruction */
21522152
JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1);

Python/generated_cases.c.h

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)