Skip to content

Commit

Permalink
Modifications for new version of bitstream (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmot committed Apr 22, 2024
1 parent 73e2460 commit 2726f4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions pyvex/lifting/gym/arm_spotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ def _load_le_instr(self, bitstream: bitstring.ConstBitStream, numbits: int) -> s
if (self.addr & 1) == 1 and numbits > 16:
chunk = ""
oldpos = bitstream.pos
for _ in range(0, numbits, 16):
chunk += bitstring.Bits(uint=bitstream.peek("uintle:%d" % 16), length=16).bin
bitstream.pos += 16
bitstream.pos = oldpos
try:
for _ in range(0, numbits, 16):
chunk += bitstring.Bits(uint=bitstream.peek("uintle:%d" % 16), length=16).bin
bitstream.pos += 16
finally:
bitstream.pos = oldpos
return chunk
return super()._load_le_instr(bitstream, numbits)

Expand Down
2 changes: 1 addition & 1 deletion pyvex/lifting/util/lifter_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _decode_next_instruction(self, addr):
# if we are out of input, ignore.
# there may be other, shorter instructions that still match,
# so we continue with the loop
except bitstring.ReadError:
except (bitstring.ReadError, bitstring.InterpretError):
pass

# If no instruction matches, log an error
Expand Down

0 comments on commit 2726f4d

Please sign in to comment.