diff options
| author | Alex Cameron <asc@tetsuo.sh> | 2021-09-15 11:02:48 +1000 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-09-15 07:58:48 -0400 |
| commit | c0fb84321d4e2fcb9e8de02c6b0faaf9d8365f37 (patch) | |
| tree | e3b8e47d3a8b21ecb1c48cdc061ea41f6a9e9458 /python/lowlevelil.py | |
| parent | 4f51a6a7a53af3dc5e1d1b9494248ae4ab326b63 (diff) | |
Use new types outside of `isinstance` checks to satisfy PyRight
Diffstat (limited to 'python/lowlevelil.py')
| -rw-r--r-- | python/lowlevelil.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index f9d70196..7a0c0a18 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -98,7 +98,7 @@ class ILRegister: def __eq__(self, other): if isinstance(other, str) and other in self.arch.regs: - index = self.arch.regs[other].index + index = self.arch.regs[architecture.RegisterName(other)].index assert index is not None other = ILRegister(self.arch, index) elif not isinstance(other, self.__class__): @@ -3046,7 +3046,7 @@ class LowLevelILFunction: elif isinstance(operation, LowLevelILOperation): operation = operation.value if isinstance(flags, str): - _flags = self.arch.get_flag_write_type_by_name(flags) + _flags = self.arch.get_flag_write_type_by_name(architecture.FlagWriteTypeName(flags)) elif isinstance(flags, ILFlag): _flags = flags.index elif flags is None: @@ -3068,12 +3068,12 @@ class LowLevelILFunction: if isinstance(original, LowLevelILInstruction): original = original.expr_index elif isinstance(original, int): - original = original + original = ExpressionIndex(original) if isinstance(new, LowLevelILInstruction): new = new.expr_index elif isinstance(new, int): - new = new + new = ExpressionIndex(new) core.BNReplaceLowLevelILExpr(self.handle, original, new) @@ -3869,7 +3869,7 @@ class LowLevelILFunction: if sem_class is not None: class_index = self.arch.get_semantic_flag_class_index(sem_class) assert isinstance(class_index, int) - return self.expr(LowLevelILOperation.LLIL_FLAG_COND, cond, class_index) + return self.expr(LowLevelILOperation.LLIL_FLAG_COND, cond, architecture.SemanticClassIndex(class_index)) def flag_group(self, sem_group) -> ExpressionIndex: """ @@ -4431,7 +4431,7 @@ class LowLevelILFunction: for i in range(len(operands)): op = operands[i] if isinstance(op, int): - operand_list[i] = op + operand_list[i] = ExpressionIndex(op) else: raise Exception("Invalid operand type") return ExpressionIndex(core.BNLowLevelILAddOperandList(self.handle, operand_list, len(operands))) |
