@@ -523,18 +523,18 @@ struct
523523 CPA. find x st.cpa
524524 end
525525
526- let rec get_mval ~man ?(full =false ) ?( checkBounds = true ) (st : store ) ((x , offs ): Addr.Mval. t ) (exp :exp option ) =
526+ let rec get_mval ~man ?(full =false ) (st : store ) ((x , offs ): Addr.Mval. t ) (exp :exp option ) =
527527 (* get hold of the variable value, either from local or global state *)
528528 let var = get_var ~man st x in
529- let v = VD. eval_offset ~check Bounds (Queries. to_value_domain_ask (Analyses. ask_of_man man)) (fun x -> get ~man st x exp) var offs exp (Some (Var x, Offs. to_cil_offset offs)) x.vtype in
529+ let v = VD. eval_offset (Queries. to_value_domain_ask (Analyses. ask_of_man man)) (fun x -> get ~man st x exp) var offs exp (Some (Var x, Offs. to_cil_offset offs)) x.vtype in
530530 if M. tracing then M. tracec " get" " var = %a, %a = %a" VD. pretty var AD. pretty (AD. of_mval (x, offs)) VD. pretty v;
531531 if full then var else match v with
532532 | Blob (c ,s ,_ ) -> c
533533 | x -> x
534534
535- and get_addr ~man ?(top =VD. top () ) ?full ?( checkBounds = true ) (st : store ) (addr : Addr.t ) (exp :exp option ) =
535+ and get_addr ~man ?(top =VD. top () ) ?full (st : store ) (addr : Addr.t ) (exp :exp option ) =
536536 match addr with
537- | Addr. Addr mval -> get_mval ~man ?full ~check Bounds st mval exp
537+ | Addr. Addr mval -> get_mval ~man ?full st mval exp
538538 | Addr. NullPtr ->
539539 begin match get_string " sem.null-pointer.dereference" with
540540 | "assume_none" -> VD. bot ()
@@ -603,7 +603,7 @@ struct
603603 | Union (f ,e ) -> reachable_from_value ask e t description
604604 (* For arrays, we ask to read from an unknown index, this will cause it
605605 * join all its values. *)
606- | Array a -> reachable_from_value ask (ValueDomain.CArrays. get ~check Bounds: false (Queries. to_value_domain_ask ask) a (None , ValueDomain.ArrIdxDomain. top () )) t description
606+ | Array a -> reachable_from_value ask (ValueDomain.CArrays. get (Queries. to_value_domain_ask ask) a (None , ValueDomain.ArrIdxDomain. top () )) t description
607607 | Blob (e ,_ ,_ ) -> reachable_from_value ask e t description
608608 | Struct s -> ValueDomain.Structs. fold (fun k v acc -> AD. join (reachable_from_value ask v t description) acc) s empty
609609 | Int _ -> empty
@@ -613,12 +613,17 @@ struct
613613 | JmpBuf _ -> empty (* Jump buffers are abstract and nothing known can be reached from them *)
614614 | Mutex -> empty (* mutexes are abstract and nothing known can be reached from them *)
615615
616+ let reachable_from_value ask (value : value ) (t : typ ) (description : string ) =
617+ let @ () = GobRef. wrap AnalysisState. executing_speculative_computations true in
618+ reachable_from_value ask value t description
619+
616620 (* Get the list of addresses accessible immediately from a given address, thus
617621 * all pointers within a structure should be considered, but we don't follow
618622 * pointers. We return a flattend representation, thus simply an address (set). *)
619623 let reachable_from_addr ~man st (addr : Addr.t ): address =
624+ let @ () = GobRef. wrap AnalysisState. executing_speculative_computations true in
620625 if M. tracing then M. tracei " reachability" " Checking for %a" Addr. pretty addr;
621- let res = reachable_from_value (Analyses. ask_of_man man) (get_addr ~man ~check Bounds: false st addr None ) (Addr. type_of addr) (Addr. show addr) in
626+ let res = reachable_from_value (Analyses. ask_of_man man) (get_addr ~man st addr None ) (Addr. type_of addr) (Addr. show addr) in
622627 if M. tracing then M. traceu " reachability" " Reachable addresses: %a" AD. pretty res;
623628 res
624629
@@ -696,6 +701,7 @@ struct
696701
697702
698703 let reachable_top_pointers_types man (ps : AD.t ) : Queries.TS.t =
704+ let @ () = GobRef. wrap AnalysisState. executing_speculative_computations true in
699705 let module TS = Queries. TS in
700706 let empty = AD. empty () in
701707 let reachable_from_address (adr : address ) =
@@ -721,7 +727,7 @@ struct
721727 | Address adrs when AD. is_top adrs -> (empty,TS. bot () , true )
722728 | Address adrs -> (adrs,TS. bot () , AD. may_be_unknown adrs)
723729 | Union (t ,e ) -> with_field (reachable_from_value e) t
724- | Array a -> reachable_from_value (ValueDomain.CArrays. get ~check Bounds: false (Queries. to_value_domain_ask (Analyses. ask_of_man man)) a (None , ValueDomain.ArrIdxDomain. top () ))
730+ | Array a -> reachable_from_value (ValueDomain.CArrays. get (Queries. to_value_domain_ask (Analyses. ask_of_man man)) a (None , ValueDomain.ArrIdxDomain. top () ))
725731 | Blob (e ,_ ,_ ) -> reachable_from_value e
726732 | Struct s ->
727733 let join_tr (a1 ,t1 ,_ ) (a2 ,t2 ,_ ) = AD. join a1 a2, TS. join t1 t2, false in
0 commit comments