summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-10-11 14:59:06 -0400
committerPeter LaFosse <peter@vector35.com>2021-10-11 14:59:24 -0400
commitf170d865f9939b18f90c849edd84e8fb5178790e (patch)
tree5a99900ada8d02b21e624650f5336fa2bd982eb5 /python
parent3213b7b89136d01c2fc37049f06223fb273450d1 (diff)
Fix return type of lowlevelil 'get_float'
Diffstat (limited to 'python')
-rw-r--r--python/lowlevelil.py6
1 files changed, 3 insertions, 3 deletions
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