8000 GH-106008: Fix refleak when peepholing `None` comparisons (#106367) · python/cpython@e4ba71f · GitHub
[go: up one dir, main page]

Skip to content

Commit e4ba71f

Browse files
authored
GH-106008: Fix refleak when peepholing None comparisons (#106367)
1 parent c9ce983 commit e4ba71f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+Fix possible reference leaks when failing to optimize comparisons with
2+
:const:`None` in the bytecode compiler.

Python/flowgraph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,9 +1377,9 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
13771377
goto error;
13781378
}
13791379
if (!Py_IsNone(cnt)) {
1380+
Py_DECREF(cnt);
13801381
break;
13811382
}
1382-
Py_DECREF(cnt);
13831383
if (bb->b_iused <= i + 2) {
13841384
break;
13851385
}

0 commit comments

Comments
 (0)
0