Skip to content

Commit

Permalink
Fix some test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
twizmwazin committed Sep 18, 2024
1 parent 7bce34f commit 36f613a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions claripy/ast/fp.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def to_fp(self, sort, rm=None):
if rm is None:
rm = fp.RM.default()

return fpToFP(rm, self, sort)
return fpToFP(self, sort, rm)

def raw_to_fp(self):
"""
Expand Down Expand Up @@ -68,7 +68,7 @@ def val_to_bv(self, size, signed=True, rm=None):
rm = fp.RM.default()

op = fpToSBV if signed else fpToUBV
return op(rm, self, size)
return op(self, size, rm)

@property
def sort(self):
Expand Down Expand Up @@ -129,7 +129,7 @@ def _fp_length_calc(_a1, a2, _a3=None):
return a2.length


fpToFP = operations.op("fpToFP", object, FP, calc_length=_fp_length_calc)
fpToFP = operations.op("fpToFP", (FP, fp.FSort, fp.RM), FP, calc_length=_fp_length_calc)
fpToFPUnsigned = operations.op("fpToFPUnsigned", (BV, fp.FSort, fp.RM), FP, calc_length=_fp_length_calc)
fpFP = operations.op("fpFP", (BV, BV, BV), FP, calc_length=lambda a, b, c: a.length + b.length + c.length)
fpToIEEEBV = operations.op("fpToIEEEBV", (FP,), BV, calc_length=lambda fp: fp.length)
Expand Down
2 changes: 1 addition & 1 deletion claripy/fp.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def fpFP(sgn, exp, mantissa):
return FPV(unpacked, sort)


def fpToSBV(rm, fp, size):
def fpToSBV(fp, size, rm):
try:
rounding_mode = rm.pydecimal_equivalent_rounding_mode()
val = int(Decimal(fp.value).to_integral_value(rounding_mode))
Expand Down

0 comments on commit 36f613a

Please sign in to comment.