Skip to content

Commit 2622dce

Browse files
committed
Fix undefined modulo operation constFold in CIL
1 parent 622dc5d commit 2622dce

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

goblint.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ dev-repo: "git+https://github.com/goblint/analyzer.git"
102102
x-maintenance-intent: ["(latest)" "(latest).(latest-1)"] # also keep previous minor version (with two releases per year, always keep a SV-COMP release)
103103
available: os-family != "bsd" & os-distribution != "alpine" & (arch != "arm64" | os = "macos")
104104
pin-depends: [
105-
[ "goblint-cil.2.0.9" "git+https://github.com/goblint/cil.git#e21285af8f4408ed5354b1674dab840c43e84712" ]
105+
[ "goblint-cil.2.0.9" "git+https://github.com/goblint/cil.git#d4ff56f4994f8acbe1544f15a103748942645961" ]
106106
# pinned for stability (https://github.com/goblint/analyzer/issues/1520), remove after new apron release
107107
[ "apron.v0.9.15" "git+https://github.com/antoinemine/apron.git#418a217c7a70dae3f422678f3aaba38ae374d91a" ]
108108
]

goblint.opam.locked

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ post-messages: [
148148
pin-depends: [
149149
[
150150
"goblint-cil.2.0.9"
151-
"git+https://github.com/goblint/cil.git#e21285af8f4408ed5354b1674dab840c43e84712"
151+
"git+https://github.com/goblint/cil.git#d4ff56f4994f8acbe1544f15a103748942645961"
152152
]
153153
[
154154
"apron.v0.9.15"

goblint.opam.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
x-maintenance-intent: ["(latest)" "(latest).(latest-1)"] # also keep previous minor version (with two releases per year, always keep a SV-COMP release)
44
available: os-family != "bsd" & os-distribution != "alpine" & (arch != "arm64" | os = "macos")
55
pin-depends: [
6-
[ "goblint-cil.2.0.9" "git+https://github.com/goblint/cil.git#e21285af8f4408ed5354b1674dab840c43e84712" ]
6+
[ "goblint-cil.2.0.9" "git+https://github.com/goblint/cil.git#d4ff56f4994f8acbe1544f15a103748942645961" ]
77
# pinned for stability (https://github.com/goblint/analyzer/issues/1520), remove after new apron release
88
[ "apron.v0.9.15" "git+https://github.com/antoinemine/apron.git#418a217c7a70dae3f422678f3aaba38ae374d91a" ]
99
]

tests/regression/39-signed-overflows/17-mod-minus-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <limits.h>
33

44
int main() {
5-
int bad = INT_MIN % -1; // TODO WARN (overflow)
5+
int bad = INT_MIN % -1; // WARN (overflow)
66
int x, y;
77
bad = x % y; // WARN (div by zero and overflow, distinguished in cram test)
88
if (y != 0) {

tests/regression/39-signed-overflows/17-mod-minus-1.t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
TODO: should warn about overflow in all three %-s
22
$ goblint --enable warn.deterministic --enable ana.int.interval 17-mod-minus-1.c
3+
[Warning][Integer > Overflow][CWE-190] Signed integer overflow in % (17-mod-minus-1.c:5:9-5:26)
34
[Warning][Integer > Overflow][CWE-190] Signed integer overflow in % (17-mod-minus-1.c:7:5-7:16)
45
[Warning][Integer > Overflow][CWE-190] Signed integer overflow in % (17-mod-minus-1.c:9:9-9:20)
56
[Warning][Integer > DivByZero][CWE-369] Second argument of modulo might be zero (17-mod-minus-1.c:7:5-7:16)
@@ -10,6 +11,7 @@ TODO: should warn about overflow in all three %-s
1011

1112
TODO: should warn about overflow in all three %-s
1213
$ goblint --enable warn.deterministic --enable ana.int.interval_set 17-mod-minus-1.c
14+
[Warning][Integer > Overflow][CWE-190] Signed integer overflow in % (17-mod-minus-1.c:5:9-5:26)
1315
[Warning][Integer > Overflow][CWE-190] Signed integer overflow in % (17-mod-minus-1.c:7:5-7:16)
1416
[Warning][Integer > Overflow][CWE-190] Signed integer overflow in % (17-mod-minus-1.c:9:9-9:20)
1517
[Warning][Integer > DivByZero][CWE-369] Second argument of modulo might be zero (17-mod-minus-1.c:7:5-7:16)

0 commit comments

Comments
 (0)