Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
zrr1999 committed Sep 2, 2023
1 parent 2536dbf commit 3f8b314
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sot/opcode_translator/instruction_utils/instruction_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
from typing import TYPE_CHECKING, Any

from .opcode_info import ABS_JUMP, ALL_JUMP, REL_JUMP
from .opcode_info import ALL_JUMP, REL_JUMP

if TYPE_CHECKING:
import types
Expand Down Expand Up @@ -185,10 +185,9 @@ def relocate_jump_target(instructions: list[Instruction]) -> None:

if instr.opname in REL_JUMP:
new_arg = jump_target - instr.offset - 2
elif instr.opname in ABS_JUMP:
else: # instr.opname in ABS_JUMP
new_arg = jump_target
else:
raise ValueError(f"Unknown jump type: {instr.opname}")

if sys.version_info >= (3, 10):
new_arg //= 2

Expand Down

0 comments on commit 3f8b314

Please sign in to comment.