@@ -69,8 +69,6 @@ let should_wrap ik = not (Cil.isSigned ik) || get_string "sem.int.signed_overflo
6969 * Always false for unsigned types, true for signed types if 'sem.int.signed_overflow' is 'assume_none' *)
7070let should_ignore_overflow ik = Cil. isSigned ik && get_string " sem.int.signed_overflow" = " assume_none"
7171
72- let widening_thresholds = ResettableLazy. from_fun WideningThresholds. thresholds
73-
7472type overflow_info = { overflow : bool ; underflow : bool ; }
7573
7674let set_overflow_flag ~cast ~underflow ~overflow ik =
@@ -92,7 +90,6 @@ let set_overflow_flag ~cast ~underflow ~overflow ik =
9290 | false , false -> assert false
9391
9492let reset_lazy () =
95- ResettableLazy. reset widening_thresholds;
9693 ana_int_config.interval_threshold_widening < - None ;
9794 ana_int_config.interval_narrow_by_meet < - None ;
9895 ana_int_config.def_exc_widen_by_join < - None ;
@@ -559,25 +556,25 @@ module IntervalArith (Ints_t : IntOps.IntOps) = struct
559556 if Ints_t. equal x1 x2 then Some x1 else None
560557
561558 let upper_threshold u max_ik =
562- let ts = if get_interval_threshold_widening_constants () = " comparisons" then WideningThresholds. upper_thresholds () else ResettableLazy. force widening_thresholds in
559+ let ts = if get_interval_threshold_widening_constants () = " comparisons" then WideningThresholds. upper_thresholds else WideningThresholds. thresholds in
563560 let u = Ints_t. to_bigint u in
564561 let max_ik' = Ints_t. to_bigint max_ik in
565- let t = WideningThresholds.Thresholds. find_first_opt (fun x -> Z. compare u x < = 0 && Z. compare x max_ik' < = 0 ) ts in
562+ let t = WideningThresholds.Thresholds. find_first_opt (fun x -> Z. compare u x < = 0 && Z. compare x max_ik' < = 0 ) ( ResettableLazy. force ts) in
566563 BatOption. map_default Ints_t. of_bigint max_ik t
567564 let lower_threshold l min_ik =
568- let ts = if get_interval_threshold_widening_constants () = " comparisons" then WideningThresholds. lower_thresholds () else ResettableLazy. force widening_thresholds in
565+ let ts = if get_interval_threshold_widening_constants () = " comparisons" then WideningThresholds. lower_thresholds else WideningThresholds. thresholds in
569566 let l = Ints_t. to_bigint l in
570567 let min_ik' = Ints_t. to_bigint min_ik in
571- let t = WideningThresholds.Thresholds. find_last_opt (fun x -> Z. compare l x > = 0 && Z. compare x min_ik' > = 0 ) ts in
568+ let t = WideningThresholds.Thresholds. find_last_opt (fun x -> Z. compare l x > = 0 && Z. compare x min_ik' > = 0 ) ( ResettableLazy. force ts) in
572569 BatOption. map_default Ints_t. of_bigint min_ik t
573570 let is_upper_threshold u =
574- let ts = if get_interval_threshold_widening_constants () = " comparisons" then WideningThresholds. upper_thresholds () else ResettableLazy. force widening_thresholds in
571+ let ts = if get_interval_threshold_widening_constants () = " comparisons" then WideningThresholds. upper_thresholds else WideningThresholds. thresholds in
575572 let u = Ints_t. to_bigint u in
576- WideningThresholds.Thresholds. exists (Z. equal u) ts
573+ WideningThresholds.Thresholds. exists (Z. equal u) ( ResettableLazy. force ts)
577574 let is_lower_threshold l =
578- let ts = if get_interval_threshold_widening_constants () = " comparisons" then WideningThresholds. lower_thresholds () else ResettableLazy. force widening_thresholds in
575+ let ts = if get_interval_threshold_widening_constants () = " comparisons" then WideningThresholds. lower_thresholds else WideningThresholds. thresholds in
579576 let l = Ints_t. to_bigint l in
580- WideningThresholds.Thresholds. exists (Z. equal l) ts
577+ WideningThresholds.Thresholds. exists (Z. equal l) ( ResettableLazy. force ts)
581578end
582579
583580module IntInvariant =
0 commit comments