]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107901: compiler replaces POP_BLOCK instruction by NOPs before optimisations ...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Thu, 25 Jan 2024 20:06:48 +0000 (20:06 +0000)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2024 20:06:48 +0000 (20:06 +0000)
Python/flowgraph.c

index de831358eb9ac83396f1d53d8359ab45c5e91593..96610b3cb11a43d4246a00f3c3a1a550ad698e35 100644 (file)
@@ -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;
@@ -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) {