From f170d865f9939b18f90c849edd84e8fb5178790e Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 11 Oct 2021 14:59:06 -0400 Subject: Fix return type of lowlevelil 'get_float' --- python/lowlevelil.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 7105d996..f1756692 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -824,13 +824,13 @@ class LowLevelILInstruction: finally: core.BNLowLevelILFreeOperandList(operand_list) - def get_float(self, operand_index:int) -> float: + def get_float(self, operand_index:int) -> Union[int, float]: if self.instr.size == 4: return struct.unpack("f", struct.pack("I", self.instr.operands[operand_index] & 0xffffffff))[0] elif self.instr.size == 8: return struct.unpack("d", struct.pack("Q", self.instr.operands[operand_index]))[0] else: - return float(self.instr.operands[operand_index]) + return self.instr.operands[operand_index] def get_expr(self, operand_index:int) -> 'LowLevelILInstruction': return LowLevelILInstruction.create(self.function, self.instr.operands[operand_index], self.instr_index) @@ -1381,7 +1381,7 @@ class LowLevelILConst_ptr(LowLevelILConstantBase): class LowLevelILFloat_const(LowLevelILConstantBase, FloatingPoint): @property - def constant(self) -> float: + def constant(self) -> Union[int, float]: return self.get_float(0) @property -- cgit v1.3.1