summaryrefslogtreecommitdiffstats
path: root/Python/flowgraph.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-01-25 20:06:48 (GMT)
committerGitHub <noreply@github.com>2024-01-25 20:06:48 (GMT)
commitac5e53e15057bc0326a03f56e400ce345d1cebeb (patch)
tree6d974dd859a39bca67bde6305bc42d58163c46e5 /Python/flowgraph.c
parent33ae9895d4ac0d88447e529038bc4725ddd8c291 (diff)
downloadcpython-ac5e53e15057bc0326a03f56e400ce345d1cebeb.zip
cpython-ac5e53e15057bc0326a03f56e400ce345d1cebeb.tar.gz
cpython-ac5e53e15057bc0326a03f56e400ce345d1cebeb.tar.bz2
gh-107901: compiler replaces POP_BLOCK instruction by NOPs before optimisations (#114530)
Diffstat (limited to 'Python/flowgraph.c')
-rw-r--r--Python/flowgraph.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index de83135..96610b3 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -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) {