From f8186c868eba120e8fa87eb8138ffdc52c1dfa16 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Wed, 19 Jan 2022 10:52:34 -0500 Subject: Turn some asserts back into exceptions --- python/highlevelil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/highlevelil.py') 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 -- cgit v1.3.1