summaryrefslogtreecommitdiff
path: root/python/lowlevelil.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-10-11 14:36:25 -0400
committerPeter LaFosse <peter@vector35.com>2021-10-11 14:59:24 -0400
commit3213b7b89136d01c2fc37049f06223fb273450d1 (patch)
tree043f81b78cd569167e958d254e6c6c258c3b19e6 /python/lowlevelil.py
parent259ef273531f53ee73fe53ea8b147fe59326a31b (diff)
Fix LowLevelIL returning an invalid ILSemanticFlagClass
Diffstat (limited to 'python/lowlevelil.py')
-rw-r--r--python/lowlevelil.py6
1 files changed, 4 insertions, 2 deletions
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