summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-09-20 15:28:19 -0400
committerPeter LaFosse <peter@vector35.com>2021-09-20 15:28:19 -0400
commit19428d17af07f9f8d8e6d6f204bc262df76b1cca (patch)
tree26309caf338f53456b5a2f0f4ba1a6c4f8ada718 /python
parent4292c27bea13a5ba0423c69e0ab3d0caa4a04e38 (diff)
Fix lowlevelil.expr when flag is an int
Diffstat (limited to 'python')
-rw-r--r--python/lowlevelil.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index c80cc5a2..2bf290e0 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -3039,7 +3039,7 @@ class LowLevelILFunction:
core.BNLowLevelILSetIndirectBranches(self.handle, branch_list, len(branches))
def expr(self, operation, a:int=0, b:int=0, c:int=0, d:int=0, size:int=0,
- flags:Union['architecture.FlagWriteTypeName', 'architecture.FlagType']=None):
+ flags:Union['architecture.FlagWriteTypeName', 'architecture.FlagType', 'architecture.FlagIndex']=None):
_flags = architecture.FlagIndex(0)
if isinstance(operation, str):
operation = LowLevelILOperation[operation]
@@ -3049,6 +3049,8 @@ class LowLevelILFunction:
_flags = self.arch.get_flag_write_type_by_name(architecture.FlagWriteTypeName(flags))
elif isinstance(flags, ILFlag):
_flags = flags.index
+ elif isinstance(flags, int):
+ _flags = architecture.FlagIndex(flags)
elif flags is None:
_flags = architecture.FlagIndex(0)
else: