File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
tests/regression/39-signed-overflows Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 22#include <limits.h>
33
44int main () {
5- int bad = INT_MIN / -1 ; // WARN
5+ int bad = INT_MIN / -1 ; // WARN (overflow)
66 int x , y ;
7+ bad = x / y ; // WARN (div by zero and overflow, distinguished in cram test)
78 if (y != 0 ) {
8- bad = x / y ; // WARN
9+ bad = x / y ; // WARN (overflow)
910 }
1011 return 0 ;
1112}
Original file line number Diff line number Diff line change 1+ $ goblint -- enable warn . deterministic -- enable ana. int . interval 15 -div-minus-1. c
2+ [Warning][Integer > Overflow][CWE-190] Signed integer overflow (15 -div-minus-1. c: 5 : 9 -5: 26 )
3+ [Warning][Integer > Overflow][CWE-190] Signed integer overflow (15 -div-minus-1. c: 7 : 5 -7: 16 )
4+ [Warning][Integer > Overflow][CWE-190] Signed integer overflow (15 -div-minus-1. c: 9 : 9 -9: 20 )
5+ [Warning][Integer > DivByZero][CWE-369] Second argument of division might be zero (15 -div-minus-1. c: 7 : 5 -7: 16 )
6+ [Info][Deadcode] Logical lines of code (LLoC) summary:
7+ live: 6
8+ dead: 0
9+ total lines : 6
10+
11+ $ goblint -- enable warn . deterministic -- enable ana. int . interval_set 15 -div-minus-1. c
12+ [Warning][Integer > Overflow][CWE-190] Signed integer overflow (15 -div-minus-1. c: 5 : 9 -5: 26 )
13+ [Warning][Integer > Overflow][CWE-190] Signed integer overflow (15 -div-minus-1. c: 9 : 9 -9: 20 )
14+ [Warning][Integer > DivByZero][CWE-369] Second argument of division might be zero (15 -div-minus-1. c: 7 : 5 -7: 16 )
15+ [Info][Deadcode] Logical lines of code (LLoC) summary:
16+ live: 6
17+ dead: 0
18+ total lines : 6
19+
Original file line number Diff line number Diff line change 1+ (cram
2+ (deps (glob_files *.c)))
You can’t perform that action at this time.
0 commit comments