mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
GH-106008: Fix refleak when peepholing None
comparisons (#106367)
This commit is contained in:
parent
c9ce983ae1
commit
e4ba71fe4b
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
Fix possible reference leaks when failing to optimize comparisons with
|
||||||
|
:const:`None` in the bytecode compiler.
|
|
@ -1377,9 +1377,9 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (!Py_IsNone(cnt)) {
|
if (!Py_IsNone(cnt)) {
|
||||||
|
Py_DECREF(cnt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Py_DECREF(cnt);
|
|
||||||
if (bb->b_iused <= i + 2) {
|
if (bb->b_iused <= i + 2) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue