Skip to content

Commit 74711c1

Browse files
committed
Remove unnecessary internal cast for binary float operations in base
1 parent e4085ed commit 74711c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/analyses/base.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,9 @@ struct
358358
Int (ID.cast_to ~kind:Internal result_ik (binop_ID result_ik op v1 v2)) (* TODO: proper castkind *)
359359
(* For the float values, we apply the float domain operators *)
360360
| Float v1, Float v2 when is_int_returning_binop_FD op ->
361-
let result_ik = Cilfacade.get_ikind t in (* TODO: isn't this always IInt? *)
362-
Int (ID.cast_to ~kind:Internal result_ik (fd_binary_pred (int_returning_binop_FD op v1 v2))) (* TODO: cast redundant/proper castkind *)
361+
let result_ik = Cilfacade.get_ikind t in
362+
assert (result_ik = IInt);
363+
Int (fd_binary_pred (int_returning_binop_FD op v1 v2))
363364
| Float v1, Float v2 -> Float (binop_FD (Cilfacade.get_fkind t) op v1 v2)
364365
(* For address +/- value, we try to do some elementary ptr arithmetic *)
365366
| Address p, Int n

0 commit comments

Comments
 (0)