Skip to content

Commit

Permalink
GH-106008: Fix refleak when peepholing None comparisons (#106367)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher authored and pull[bot] committed Jul 11, 2023
1 parent d18b3eb commit 2002177
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
@@ -0,0 +1,2 @@
Fix possible reference leaks when failing to optimize comparisons with
:const:`None` in the bytecode compiler.
2 changes: 1 addition & 1 deletion Python/flowgraph.c
Expand Up @@ -1377,9 +1377,9 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
goto error;
}
if (!Py_IsNone(cnt)) {
Py_DECREF(cnt);
break;
}
Py_DECREF(cnt);
if (bb->b_iused <= i + 2) {
break;
}
Expand Down

0 comments on commit 2002177

Please sign in to comment.