summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-07-20 22:01:42 (GMT)
committerGitHub <noreply@github.com>2022-07-20 22:01:42 (GMT)
commite2fce3a8e77d33d52d47b567964ddebd6984a097 (patch)
tree52c224420a99a3c7fb4e928cc270985ea05fb52a /Python
parent6515738c0e6b2ff3ed5ce40fb0d61632648efbe3 (diff)
downloadcpython-e2fce3a8e77d33d52d47b567964ddebd6984a097.zip
cpython-e2fce3a8e77d33d52d47b567964ddebd6984a097.tar.gz
cpython-e2fce3a8e77d33d52d47b567964ddebd6984a097.tar.bz2
[3.11] GH-91409: Don't overwrite valid locations with NOP locations (GH-95067) (GH-95068)
(cherry picked from commit 742d4614e1a645d765dbf76c19bd9a818239b1cb)
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 3fe0930..e8acd85 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;
}