Skip to content

Commit 7e087d7

Browse files
committed
Don't assume next block has instructions
1 parent d0c9943 commit 7e087d7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Python/flowgraph.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3617,7 +3617,10 @@ propagate_line_numbers(basicblock *entryblock) {
36173617
}
36183618
if (is_jump(last)) {
36193619
basicblock *target = last->i_target;
3620-
if (target->b_predecessors == 1) {
3620+
while (target->b_iused == 0 && target->b_predecessors == 1) {
3621+
target = target->b_next;
3622+
}
3623+
if (target->b_predecessors == 1 && target->b_iused > 0) {
36213624
if (target->b_instr[0].i_loc.lineno == NO_LOCATION.lineno) {
36223625
target->b_instr[0].i_loc = prev_location;
36233626
}

0 commit comments

Comments
 (0)