Skip to content

Commit

Permalink
fix address underflow on disassemble (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
SWW13 committed May 21, 2021
1 parent 2479d6a commit 4ae9dbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gef.py
Expand Up @@ -1303,7 +1303,7 @@ def gdb_get_nth_previous_instruction_address(addr, n):
"""Return the address (Integer) of the `n`-th instruction before `addr`."""
# fixed-length ABI
if current_arch.instruction_length:
return addr - n * current_arch.instruction_length
return max(0, addr - n * current_arch.instruction_length)

# variable-length ABI
cur_insn_addr = gef_current_instruction(addr).address
Expand Down

0 comments on commit 4ae9dbb

Please sign in to comment.