You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/cdomain/value/cdomains/int/bitfieldDomain.ml
+29-32Lines changed: 29 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -625,41 +625,38 @@ module BitfieldFunctor (Ints_t : IntOps.IntOps): Bitfield_SOverflow with type in
625
625
(* Invariant *)
626
626
627
627
letinvariant_ikindeik (z, o) =
628
-
ifBArith.is_invalid (z, o) then
629
-
Invariant.none (* TODO: should this ever even happen? *)
630
-
else (
631
-
letopenGoblintCil.Cilin
632
-
let ik_type =TInt (ik, []) in
633
-
let i1 =
634
-
let def0 = z &: (!: o) in
635
-
if def0 =:BArith.zero_mask then
636
-
Invariant.none
637
-
else (
638
-
let def0 =Ints_t.to_bigint def0 in
639
-
if fitsInInt ik def0 then ( (* At least for _Bool and unsigned types, kintegerCilint can give an incorrect mask if doesn't fit. See https://github.com/goblint/analyzer/pull/1897/changes#r2610251390. *)
640
-
let def0 = kintegerCilint ik def0 in
641
-
Invariant.of_exp (BinOp (Eq, (BinOp (BAnd, e, def0, ik_type)), kintegerCilint ik Z.zero, intType))
642
-
)
643
-
else
644
-
Invariant.none
628
+
assert (not (BArith.is_invalid (z, o)));
629
+
letopenGoblintCil.Cilin
630
+
let ik_type =TInt (ik, []) in
631
+
let i1 =
632
+
let def0 = z &: (!: o) in
633
+
if def0 =:BArith.zero_mask then
634
+
Invariant.none
635
+
else (
636
+
let def0 =Ints_t.to_bigint def0 in
637
+
if fitsInInt ik def0 then ( (* At least for _Bool and unsigned types, kintegerCilint can give an incorrect mask if doesn't fit. See https://github.com/goblint/analyzer/pull/1897/changes#r2610251390. *)
638
+
let def0 = kintegerCilint ik def0 in
639
+
Invariant.of_exp (BinOp (Eq, (BinOp (BAnd, e, def0, ik_type)), kintegerCilint ik Z.zero, intType))
645
640
)
646
-
in
647
-
let i2 =
648
-
let def1 = o &: (!: z) in
649
-
if def1 =:BArith.zero_mask then
641
+
else
650
642
Invariant.none
651
-
else (
652
-
let def1 =Ints_t.to_bigint def1 in
653
-
if fitsInInt ik def1 then ( (* At least for _Bool and unsigned types, kintegerCilint can give an incorrect mask if doesn't fit. See https://github.com/goblint/analyzer/pull/1897/changes#r2610251390. *)
654
-
let def1 = kintegerCilint ik def1 in
655
-
Invariant.of_exp (BinOp (Eq, (BinOp (BAnd, e, def1, ik_type)), def1, intType))
656
-
)
657
-
else
658
-
Invariant.none
643
+
)
644
+
in
645
+
let i2 =
646
+
let def1 = o &: (!: z) in
647
+
if def1 =:BArith.zero_mask then
648
+
Invariant.none
649
+
else (
650
+
let def1 =Ints_t.to_bigint def1 in
651
+
if fitsInInt ik def1 then ( (* At least for _Bool and unsigned types, kintegerCilint can give an incorrect mask if doesn't fit. See https://github.com/goblint/analyzer/pull/1897/changes#r2610251390. *)
652
+
let def1 = kintegerCilint ik def1 in
653
+
Invariant.of_exp (BinOp (Eq, (BinOp (BAnd, e, def1, ik_type)), def1, intType))
0 commit comments