summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/highlevelil.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/highlevelil.py b/python/highlevelil.py
index d85905b1..e1d26f62 100644
--- a/python/highlevelil.py
+++ b/python/highlevelil.py
@@ -543,8 +543,14 @@ class HighLevelILInstruction(object):
@property
def il_basic_block(self):
- """IL basic block object containing this expression (read-only) (only available on finalized functions)"""
- return HighLevelILBasicBlock(self._function.source_function.view, core.BNGetHighLevelILBasicBlockForInstruction(self._function.handle, self._instr_index), self._function)
+ """
+ IL basic block object containing this expression (read-only) (only available on finalized functions).
+ Returns None for HLIL_BLOCK expressions as these can contain multiple basic blocks.
+ """
+ block = core.BNGetHighLevelILBasicBlockForInstruction(self._function.handle, self._instr_index)
+ if not block:
+ return None
+ return HighLevelILBasicBlock(self._function.source_function.view, block, self._function)
@property
def value(self):