diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-09-22 11:30:45 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-09-22 11:31:32 -0400 |
| commit | e9a35074bb068e4d71d0f60c520128b245edac48 (patch) | |
| tree | cd5c37a9139dcfd2623925a2dab07b4673e57a47 /python/basicblock.py | |
| parent | e8f1068684236e5805e511b9abfd83888f05a1f9 (diff) | |
Add __contains__ for Function, Section, Segment, BasicBlock and BinaryView
Addresses issue binaryninja-api#1113
Diffstat (limited to 'python/basicblock.py')
| -rw-r--r-- | python/basicblock.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/python/basicblock.py b/python/basicblock.py index 623cc3ed..872e44b8 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -129,6 +129,9 @@ class BasicBlock: data = self.view.read(start, length) return self.arch.get_instruction_text(data, start) + def __contains__(self, i:int): + return i >= self.start and i < self.end + def _buildStartCache(self) -> None: if self._instStarts is None: # build the instruction start cache |
