Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read branch targets as signed integers #18

Merged
merged 1 commit into from Jun 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions dncil/cil/body/reader.py
Expand Up @@ -111,7 +111,7 @@ def read_inline_br_target(self, insn: Instruction) -> Tuple[int, bytes]:
branch_offset: int
branch_offset_bytes: bytes

branch_offset, branch_offset_bytes = self.read_uint32()
branch_offset, branch_offset_bytes = self.read_int32()
return insn.offset + insn.size + branch_offset, branch_offset_bytes

def read_inline_field(self, insn: Instruction) -> Tuple[Token, bytes]:
Expand Down Expand Up @@ -179,7 +179,7 @@ def read_inline_switch(self, insn: Instruction) -> Tuple[list, bytes]:
branch_offset: int
branch_offset_raw: bytes

branch_offset, branch_offset_raw = self.read_uint32()
branch_offset, branch_offset_raw = self.read_int32()
branches.append(offset_after_insn + branch_offset)
branches_bytes += branch_offset_raw

Expand Down Expand Up @@ -220,7 +220,7 @@ def read_short_inline_br_target(self, insn: Instruction) -> Tuple[int, bytes]:
branch_offset: int
branch_offset_bytes: bytes

branch_offset, branch_offset_bytes = self.read_uint8()
branch_offset, branch_offset_bytes = self.read_int8()
return insn.offset + insn.size + branch_offset, branch_offset_bytes

def read_short_inline_i(self, insn: Instruction) -> Tuple[int, bytes]:
Expand Down