diff options
| author | Peter LaFosse <peter@vector35.com> | 2022-01-19 10:52:34 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2022-01-19 15:20:47 -0500 |
| commit | f8186c868eba120e8fa87eb8138ffdc52c1dfa16 (patch) | |
| tree | c9e3ccca9440875f2ee54c79582ab3da5af0e2c1 /python/highlevelil.py | |
| parent | 6f5fd10c589cd7bf525d91a60a0dc66bc4f93e25 (diff) | |
Turn some asserts back into exceptions
Diffstat (limited to 'python/highlevelil.py')
| -rw-r--r-- | python/highlevelil.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/highlevelil.py b/python/highlevelil.py index b757727d..647f8503 100644 --- a/python/highlevelil.py +++ b/python/highlevelil.py @@ -626,7 +626,8 @@ class HighLevelILInstruction(BaseILInstruction): ExpressionIndex(self.core_instr.operands[operand_index])) def get_intrinsic(self, operand_index:int) -> 'lowlevelil.ILIntrinsic': - assert self.function.arch is not None, "Attempting to create ILIntrinsic from function with no Architecture" + if self.function.arch is None: + raise ValueError("Attempting to create ILIntrinsic from function with no Architecture") return lowlevelil.ILIntrinsic(self.function.arch, architecture.IntrinsicIndex(self.core_instr.operands[operand_index])) @@ -2197,7 +2198,7 @@ class HighLevelILFunction: def ssa_form(self) -> 'HighLevelILFunction': """High level IL in SSA form (read-only)""" result = core.BNGetHighLevelILSSAForm(self.handle) - assert result is not None + assert result is not None, "core.BNGetHighLevelILSSAForm returned None" return HighLevelILFunction(self._arch, result, self._source_function) @property |
