Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Make sure that all backwards jumps use the ``JUMP_ABSOLUTE`` instruction, rather
than ``JUMP_FORWARD`` with an argument of ``(2**32)+offset``.
5 changes: 5 additions & 0 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -6702,6 +6702,11 @@ assemble_emit(struct assembler *a, struct instr *i)
}

static void
if (last->i_opcode == JUMP_FORWARD) {
if (last->i_target->b_visited == 1) {
last->i_opcode = JUMP_ABSOLUTE;
}
}
assemble_jump_offsets(struct assembler *a, struct compiler *c)
{
basicblock *b;
Expand Down