File tree 2 files changed +25
-2
lines changed
tests/regression/38-int-refinements
2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -151,10 +151,15 @@ end
151
151
module HConsed (Base :S ) =
152
152
struct
153
153
include Printable. HConsed (Base )
154
+
155
+ (* We do refine int values on narrow and meet {!IntDomain.IntDomTupleImpl}, which can lead to fixpoint issues if we assume x op x = x *)
156
+ (* see https://github.com/goblint/analyzer/issues/1005 *)
157
+ let int_refine_active = GobConfig. get_string " ana.int.refinement" <> " never"
158
+
154
159
let lift_f2 f x y = f (unlift x) (unlift y)
155
- let narrow x y = if x.BatHashcons. tag == y.BatHashcons. tag then x else lift (lift_f2 Base. narrow x y)
160
+ let narrow x y = if ( not int_refine_active) && x.BatHashcons. tag == y.BatHashcons. tag then x else lift (lift_f2 Base. narrow x y)
156
161
let widen x y = if x.BatHashcons. tag == y.BatHashcons. tag then x else lift (lift_f2 Base. widen x y)
157
- let meet x y = if x.BatHashcons. tag == y.BatHashcons. tag then x else lift (lift_f2 Base. meet x y)
162
+ let meet x y = if ( not int_refine_active) && x.BatHashcons. tag == y.BatHashcons. tag then x else lift (lift_f2 Base. meet x y)
158
163
let join x y = if x.BatHashcons. tag == y.BatHashcons. tag then x else lift (lift_f2 Base. join x y)
159
164
let leq x y = (x.BatHashcons. tag == y.BatHashcons. tag) || lift_f2 Base. leq x y
160
165
let is_top = lift_f Base. is_top
Original file line number Diff line number Diff line change
1
+ // PARAM: --set ana.int.refinement fixpoint --enable ana.int.interval
2
+ // FIXPOINT
3
+ #include <assert.h>
4
+
5
+ int g = 0 ;
6
+
7
+ void main ()
8
+ {
9
+ int i = 0 ;
10
+ while (1 ) {
11
+ i ++ ;
12
+ for (int j = 0 ; j < 10 ; j ++ ) {
13
+ if (i > 100 ) g = 1 ;
14
+ }
15
+ if (i > 9 ) i = 0 ;
16
+ }
17
+ return ;
18
+ }
You can’t perform that action at this time.
0 commit comments