let frama_C_is_base_aligned state actuals =
try begin
match actuals with
[_,x,_; _,y,_] ->
let i = Cvalue_type.V.project_ival y in
begin match i with
Ival.Set si ->
Locations.Location_Bytes.fold_i
(fun b _o () ->
Ival.O.iter
(fun int ->
if not (Base.is_aligned_by b int)
then raise Found_misaligned_base)
si)
x
();
(wrap_int Cvalue_type.V.singleton_one),
state,
Locations.Location_Bits.Top_Param.bottom
| _ -> raise Found_misaligned_base
end
| _ -> raise Base_aligned_error
end
with Base_aligned_error ->
Cilmsg.error "Invalid arguments for Frama_C_is_base_aligned function" ;
Value_util.do_degenerate None;
raise Db.Value.Aborted
| Found_misaligned_base
| Not_found ->
(wrap_int Cvalue_type.V.zero_or_one),
state,
Locations.Location_Bits.Top_Param.bottom