From e2fce3a8e77d33d52d47b567964ddebd6984a097 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Wed, 20 Jul 2022 15:01:42 -0700 Subject: [3.11] GH-91409: Don't overwrite valid locations with NOP locations (GH-95067) (GH-95068) (cherry picked from commit 742d4614e1a645d765dbf76c19bd9a818239b1cb) --- Python/compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Python') diff --git a/Python/compile.c b/Python/compile.c index 3fe0930e7ae..e8acd859777 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -9045,7 +9045,10 @@ clean_basic_block(basicblock *bb) { /* or, if the next instruction has same line number or no line number */ if (src < bb->b_iused - 1) { int next_lineno = bb->b_instr[src+1].i_lineno; - if (next_lineno < 0 || next_lineno == lineno) { + if (next_lineno == lineno) { + continue; + } + if (next_lineno < 0) { COPY_INSTR_LOC(bb->b_instr[src], bb->b_instr[src+1]); continue; } -- cgit v1.3.1