Skip to content

Commit 64f3010

Browse files
Merge pull request #53 from goblint/no_cilint
Use `Cilint` in `CInt64`
2 parents 8383534 + 9ad7b51 commit 64f3010

File tree

10 files changed

+243
-494
lines changed

10 files changed

+243
-494
lines changed

.merlin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ B _build/src/ext/
99
B _build/src/ext/pta/
1010
B _build/src/frontc/
1111
B _build/src/ocamlutil/
12-
PKG findlib
12+
PKG findlib, zarith

src/check.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ and checkInit (i: init) : typ =
641641
match elen with
642642
| None -> 0L
643643
| Some e -> (ignore (checkExp true e);
644-
match isInteger (constFold true e) with
645-
Some len -> len
644+
match getInteger (constFold true e) with
645+
Some len -> Z.to_int64 len (* Z on purpose, we don't want to ignore overflows here *)
646646
| None ->
647647
ignore (warn "Array length is not a constant");
648648
0L)
@@ -652,10 +652,10 @@ and checkInit (i: init) : typ =
652652
if i > len then
653653
ignore (warn "Wrong number of initializers in array")
654654

655-
| (Index(Const(CInt64(i', _, _)), NoOffset), ei) :: rest ->
656-
if i' <> i then
655+
| (Index(Const(CInt(i', _, _)), NoOffset), ei) :: rest ->
656+
if Int64.compare (Z.to_int64 i') i <> 0 then
657657
ignore (warn "Initializer for index %s when %s was expected"
658-
(Int64.format "%d" i') (Int64.format "%d" i));
658+
(Int64.format "%d" (Z.to_int64 i')) (Int64.format "%d" i));
659659
checkInitType ei bt;
660660
loopIndex (Int64.succ i) rest
661661
| _ :: rest ->

0 commit comments

Comments
 (0)