Skip to content

Commit ac5e53e

Browse files
authored
gh-107901: compiler replaces POP_BLOCK instruction by NOPs before optimisations (#114530)
1 parent 33ae989 commit ac5e53e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/flowgraph.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,7 @@ label_exception_targets(basicblock *entryblock) {
903903
}
904904
else if (instr->i_opcode == POP_BLOCK) {
905905
handler = pop_except_block(except_stack);
906+
INSTR_SET_OP0(instr, NOP);
906907
}
907908
else if (is_jump(instr)) {
908909
instr->i_except = handler;
@@ -2313,7 +2314,7 @@ convert_pseudo_ops(cfg_builder *g)
23132314
for (basicblock *b = entryblock; b != NULL; b = b->b_next) {
23142315
for (int i = 0; i < b->b_iused; i++) {
23152316
cfg_instr *instr = &b->b_instr[i];
2316-
if (is_block_push(instr) || instr->i_opcode == POP_BLOCK) {
2317+
if (is_block_push(instr)) {
23172318
INSTR_SET_OP0(instr, NOP);
23182319
}
23192320
else if (instr->i_opcode == LOAD_CLOSURE) {

0 commit comments

Comments
 (0)