@@ -344,7 +344,7 @@ struct
344344 * adding proper dependencies.
345345 * For the exp argument it is always ok to put None. This means not using precise information about
346346 * which part of an array is involved. *)
347- let rec get ?(full =false ) a (gs : glob_fun ) (st : store ) (addrs :address ) (exp :exp option ): value =
347+ let rec get ?(top = VD. top () ) ?( full =false ) a (gs : glob_fun ) (st : store ) (addrs :address ) (exp :exp option ): value =
348348 let at = AD. get_type addrs in
349349 let firstvar = if M. tracing then match AD. to_var_may addrs with [] -> " " | x :: _ -> x.vname else " " in
350350 if M. tracing then M. traceli " get" ~var: firstvar " Address: %a\n State: %a\n " AD. pretty addrs CPA. pretty st.cpa;
@@ -362,7 +362,7 @@ struct
362362 let f = function
363363 | Addr. Addr (x , o ) -> f_addr (x, o)
364364 | Addr. NullPtr -> VD. bot () (* TODO: why bot? *)
365- | Addr. UnknownPtr -> VD. top ( )
365+ | Addr. UnknownPtr -> top (* top may be more precise than VD.top, e.g. for address sets, such that known addresses are kept for soundness * )
366366 | Addr. StrPtr _ -> `Int (ID. top_of IChar )
367367 in
368368 (* We form the collecting function by joining *)
@@ -724,7 +724,7 @@ struct
724724 | _ -> false
725725 in
726726 if AD. for_all cast_ok p then
727- get a gs st p (Some exp) (* downcasts are safe *)
727+ get ~top: ( VD. top_value t) a gs st p (Some exp) (* downcasts are safe *)
728728 else
729729 VD. top () (* upcasts not! *)
730730 in
0 commit comments