Skip to content

Commit 6e9d577

Browse files
Treat call as jump in JIT assembly backend optimizer on x86-64
1 parent 92243dc commit 6e9d577

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tools/jit/_optimizers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ class OptimizerX86(Optimizer): # pylint: disable = too-few-public-methods
629629
rf"\s*(?P<instruction>{'|'.join(_X86_BRANCHES)})\s+(?P<target>[\w.]+)"
630630
)
631631
# https://www.felixcloutier.com/x86/jmp
632-
_re_jump = re.compile(r"\s*jmp\s+(?P<target>[\w.]+)")
632+
# https://www.felixcloutier.com/x86/call
633+
# Calls are also logically jumps to labels.
634+
_re_jump = re.compile(r"\s*((?:jmp)|(?:callq?))\s+(?P<target>[\w.]+)")
633635
# https://www.felixcloutier.com/x86/ret
634636
_re_return = re.compile(r"\s*ret\b")

0 commit comments

Comments
 (0)