Skip to content

Commit

Permalink
pythongh-107901: compiler replaces POP_BLOCK instruction by NOPs befo…
Browse files Browse the repository at this point in the history
…re optimisations (python#114530)
  • Loading branch information
iritkatriel authored and aisk committed Feb 11, 2024
1 parent 2138901 commit ae12bee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ label_exception_targets(basicblock *entryblock) {
}
else if (instr->i_opcode == POP_BLOCK) {
handler = pop_except_block(except_stack);
INSTR_SET_OP0(instr, NOP);
}
else if (is_jump(instr)) {
instr->i_except = handler;
Expand Down Expand Up @@ -2313,7 +2314,7 @@ convert_pseudo_ops(cfg_builder *g)
for (basicblock *b = entryblock; b != NULL; b = b->b_next) {
for (int i = 0; i < b->b_iused; i++) {
cfg_instr *instr = &b->b_instr[i];
if (is_block_push(instr) || instr->i_opcode == POP_BLOCK) {
if (is_block_push(instr)) {
INSTR_SET_OP0(instr, NOP);
}
else if (instr->i_opcode == LOAD_CLOSURE) {
Expand Down

0 comments on commit ae12bee

Please sign in to comment.