diff options
Diffstat (limited to 'python/lowlevelil.py')
| -rw-r--r-- | python/lowlevelil.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 4d4ca2ec..87400b4d 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -1304,8 +1304,10 @@ class LowLevelILFunction(object): # for backwards compatibility if isinstance(i, LowLevelILInstruction): return i - if (i < 0) or (i >= len(self)): + if i < -len(self) or i >= len(self): raise IndexError("index out of range") + if i < 0: + i = len(self) + i return LowLevelILInstruction(self, core.BNGetLowLevelILIndexForInstruction(self.handle, i), i) def __setitem__(self, i, j): |
