From 3213b7b89136d01c2fc37049f06223fb273450d1 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 11 Oct 2021 14:36:25 -0400 Subject: Fix LowLevelIL returning an invalid ILSemanticFlagClass --- python/lowlevelil.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/lowlevelil.py') diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 1f6914de..7105d996 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -865,7 +865,9 @@ class LowLevelILInstruction: architecture.RegisterStackIndex(self.instr.operands[operand_index1])) return SSARegisterStack(reg_stack, self.instr.operands[operand_index2]) - def get_sem_class(self, operand_index:int) -> ILSemanticFlagClass: + def get_sem_class(self, operand_index:int) -> Optional[ILSemanticFlagClass]: + if self.instr.operands[operand_index] == 0: + return None return ILSemanticFlagClass(self.function.arch, architecture.SemanticClassIndex(self.instr.operands[operand_index])) @@ -1915,7 +1917,7 @@ class LowLevelILFlag_cond(LowLevelILInstruction): return self.get_cond(0) @property - def semantic_class(self) -> ILSemanticFlagClass: + def semantic_class(self) -> Optional[ILSemanticFlagClass]: return self.get_sem_class(1) @property -- cgit v1.3.1