summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index c67e8e8..ea9d678 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -6514,6 +6514,7 @@ is_exit_without_lineno(basicblock *b) {
static int
ensure_exits_have_lineno(struct compiler *c)
{
+ basicblock *entry = NULL;
/* Copy all exit blocks without line number that are targets of a jump.
*/
for (basicblock *b = c->u->u_blocks; b != NULL; b = b->b_list) {
@@ -6535,6 +6536,11 @@ ensure_exits_have_lineno(struct compiler *c)
b->b_instr[b->b_iused-1].i_target = new_target;
}
}
+ entry = b;
+ }
+ assert(entry != NULL);
+ if (is_exit_without_lineno(entry)) {
+ entry->b_instr[0].i_lineno = c->u->u_firstlineno;
}
/* Any remaining reachable exit blocks without line number can only be reached by
* fall through, and thus can only have a single predecessor */