diff options
| author | Galen Williamson <galen@vector35.com> | 2021-07-07 17:11:22 -0400 |
|---|---|---|
| committer | Galen Williamson <galen@vector35.com> | 2021-07-07 17:11:22 -0400 |
| commit | 468d9184a343beeac9cac2e492a1f842a6a3234e (patch) | |
| tree | 9e47d73248577c504bb52904af39273070287c51 /python/highlevelil.py | |
| parent | be766bb6b82e5600ef56e8a3610229298669e8cb (diff) | |
Added slicing support to __getitem__ in all basic block classes
Diffstat (limited to 'python/highlevelil.py')
| -rw-r--r-- | python/highlevelil.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/highlevelil.py b/python/highlevelil.py index 046d73a6..d3312474 100644 --- a/python/highlevelil.py +++ b/python/highlevelil.py @@ -976,6 +976,8 @@ class HighLevelILBasicBlock(basicblock.BasicBlock): def __getitem__(self, idx): size = self.end - self.start + if isinstance(idx, slice): + return [self[index] for index in range(*idx.incides(size))] if idx > size or idx < -size: raise IndexError("list index is out of range") if idx >= 0: |
