Skip to content

Commit 648198c

Browse files
authored
[3.12] gh-109889: comment out assertion indicating a failed optimization of a redundant NOP (#109899)
* [3.12] gh-109889: comment out assertion indicating a failed optimization of a redundant NOP * comment out the function to avoid warnings on it being unused
1 parent 57ff216 commit 648198c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Python/flowgraph.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ _PyCfgBuilder_Addop(cfg_builder *g, int opcode, int oparg, location loc)
366366
#ifndef NDEBUG
367367
static int remove_redundant_nops(basicblock *bb);
368368

369+
/*
369370
static bool
370371
no_redundant_nops(cfg_builder *g) {
371372
for (basicblock *b = g->g_entryblock; b != NULL; b = b->b_next) {
@@ -375,6 +376,7 @@ no_redundant_nops(cfg_builder *g) {
375376
}
376377
return true;
377378
}
379+
*/
378380

379381
static bool
380382
no_empty_basic_blocks(cfg_builder *g) {
@@ -1595,7 +1597,11 @@ optimize_cfg(cfg_builder *g, PyObject *consts, PyObject *const_cache)
15951597
remove_redundant_nops(b);
15961598
}
15971599
eliminate_empty_basic_blocks(g);
1598-
assert(no_redundant_nops(g));
1600+
/* This assertion fails in an edge case (See gh-109889).
1601+
* Remove it for the release (it's just one more NOP in the
1602+
* bytecode for unlikely code).
1603+
*/
1604+
// assert(no_redundant_nops(g));
15991605
RETURN_IF_ERROR(remove_redundant_jumps(g));
16001606
return SUCCESS;
16011607
}

0 commit comments

Comments
 (0)