Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Prev Previous commit
Next Next commit
move trim_unused_consts to assembly stage
  • Loading branch information
iritkatriel committed Sep 29, 2022
commit 98270301ace259ff3b64a82a381641c61169a300
6 changes: 3 additions & 3 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8644,9 +8644,6 @@ assemble(struct compiler *c, int addNone)
if (optimize_cfg(g, consts, c->c_const_cache)) {
goto error;
}
if (trim_unused_consts(g->g_entryblock, consts)) {
goto error;
}
if (duplicate_exits_without_lineno(g) < 0) {
goto error;
}
Expand Down Expand Up @@ -8682,6 +8679,9 @@ assemble(struct compiler *c, int addNone)
/* Can't modify the bytecode after computing jump offsets. */
assemble_jump_offsets(g->g_entryblock);

if (trim_unused_consts(g->g_entryblock, consts)) {
goto error;
}

/* Create assembler */
if (!assemble_init(&a, c->u->u_firstlineno))
Expand Down