let offsetmap_top_addresses_of_locals is_local =
    let is_local_bytes = Location_Bytes.contains_addresses_of_locals is_local in
    fun offsetmap ->
      if Cvalue_type.V_Offsetmap.is_empty offsetmap
      then offsetmap, true
      else
        let found_locals = ref false in
        let loc_contains_addresses_of_locals t =
          let l =
            is_local_bytes (Cvalue_type.V_Or_Uninitialized.get_v t)
          in
          found_locals := !found_locals
          || (l
              && (match Cvalue_type.V_Or_Uninitialized.get_v t with
                  | Location_Bytes.Top (Location_Bytes.Top_Param.Top,_) -> false
                      (* Do not be too verbose if the value is top. *)
                  | _ -> true));
          l
        in
        let result =
          Cvalue_type.V_Offsetmap.top_stuff
            loc_contains_addresses_of_locals
            (fun v ->
               Cvalue_type.V_Or_Uninitialized.unspecify_escaping_locals
                 is_local v)
            offsetmap
        in
        result, !found_locals