You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One can also annotate pointer parameters. Inside the function of the parameter, Goblint tries to use the annotated domain for the arrays pointed at by that pointer. This is not guaranteed to work, as following the pointers is done only in the first analyzed function context.
51
+
52
+
29
53
30
54
## Functions
31
55
Goblint-specific functions can be called in the code, where they assist the analyzer but have no runtime effect.
let pa =GobList.combine_short fundec.sformals vals in(* TODO: is it right to ignore missing formals/args? *)
2390
+
add_to_array_map fundec pa;
2353
2391
let new_cpa =CPA.add_list pa st'.cpa in
2354
2392
(* List of reachable variables *)
2355
2393
let reachable =List.concat_map AD.to_var_may (reachable_vars (Analyses.ask_of_ctx ctx) (get_ptrs vals) ctx.global st) in
@@ -2358,7 +2396,7 @@ struct
2358
2396
2359
2397
(* Projection to Precision of the Callee *)
2360
2398
let p =PU.int_precision_from_fundec fundec in
2361
-
let new_cpa = project (Some p) new_cpa in
2399
+
let new_cpa = project (Analyses.ask_of_ctx ctx) (Some p) new_cpa fundecin
2362
2400
2363
2401
(* Identify locals of this fundec for which an outer copy (from a call down the callstack) is reachable *)
2364
2402
let reachable_other_copies =List.filter (funv -> matchCilfacade.find_scope_fundec v withSomescope ->CilType.Fundec.equal scope fundec |None ->false) reachable in
@@ -2720,9 +2758,13 @@ struct
2720
2758
let nst = add_globals st fun_st in
2721
2759
2722
2760
(* Projection to Precision of the Caller *)
2723
-
let p =PrecisionUtil.int_precision_from_node ()in(* Since f is the fundec of the Callee we have to get the fundec of the current Node instead *)
2724
-
let return_val = project_val (Some p) return_val (is_privglob (return_varinfo ())) in
2725
-
let cpa' = project (Some p) nst.cpa in
2761
+
let p =PrecisionUtil.int_precision_from_node ()in(* Since f is the fundec of the Callee we have to get the fundec of the current Node instead *)
2762
+
let callerFundec =match!MyCFG.current_node with
2763
+
|Somen -> Node.find_fundec n
2764
+
|None -> failwith "callerfundec not found"
2765
+
in
2766
+
let return_val = project_val (Analyses.ask_of_ctx ctx) (attributes_varinfo (return_varinfo ()) callerFundec) (Some p) return_val (is_privglob (return_varinfo ())) in
2767
+
let cpa' = project (Analyses.ask_of_ctx ctx) (Some p) nst.cpa callerFundec in
2726
2768
2727
2769
let st = { nst with cpa = cpa'; weak = st.weak } in(* keep weak from caller *)
0 commit comments