summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-07-20 21:27:31 (GMT)
committerGitHub <noreply@github.com>2022-07-20 21:27:31 (GMT)
commit742d4614e1a645d765dbf76c19bd9a818239b1cb (patch)
treef3a188e7fb56a3fbf657bd5b9f3621506e49deec /Python
parent41e0585ffabfcd227718a247a02285ea590ed51e (diff)
downloadcpython-742d4614e1a645d765dbf76c19bd9a818239b1cb.zip
cpython-742d4614e1a645d765dbf76c19bd9a818239b1cb.tar.gz
cpython-742d4614e1a645d765dbf76c19bd9a818239b1cb.tar.bz2
GH-91409: Don't overwrite valid locations with NOP locations (GH-95067)
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 20eca05..52b7d92 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -9278,7 +9278,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_loc.lineno;
- if (next_lineno < 0 || next_lineno == lineno) {
+ if (next_lineno == lineno) {
+ continue;
+ }
+ if (next_lineno < 0) {
bb->b_instr[src+1].i_loc = bb->b_instr[src].i_loc;
continue;
}