diff options
| author | 3rdit <llerdit@gmail.com> | 2026-01-22 21:20:24 +0000 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2026-02-16 16:21:22 -0500 |
| commit | 157045084b8938d02811f100f7b236685472658c (patch) | |
| tree | 4f278fa724c42dc54adfaa8c2a1cf048f5508bb8 /python | |
| parent | 2a4c7d5d89907497e029337bbaf6f7e467bcde98 (diff) | |
Fix slice handling in TagList to match FunctionList/BasicBlockList fix
Diffstat (limited to 'python')
| -rw-r--r-- | python/function.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/python/function.py b/python/function.py index b66fd039..39c36356 100644 --- a/python/function.py +++ b/python/function.py @@ -400,10 +400,8 @@ class TagList: return arch, self._tags[i].addr, binaryview.Tag(core_tag) elif isinstance(i, slice): result = [] - if i.start < 0 or i.start >= len(self) or i.stop < 0 or i.stop >= len(self): - raise IndexError(f"Slice {i} out of bounds for TagList of size {len(self)}") - - for j in range(i.start, i.stop, i.step if i.step is not None else 1): + start, stop, step = i.indices(len(self)) + for j in range(start, stop, step): core_tag = core.BNNewTagReference(self._tags[j].tag) assert core_tag is not None, "core.BNNewTagReference returned None" arch = architecture.CoreArchitecture._from_cache(self._tags[j].arch) |
