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
RD.remove_vars_with new_fun_rel arg_vars; (* fine to remove arg vars that also exist in caller because unify from new_rel adds them back with proper constraints *)
381
+
let tainted = f_ask.f Queries.MayBeTaintedin
382
+
let tainted_vars =TaintPartialContexts.conv_varset tainted in
381
383
let new_rel =RD.keep_filter st.rel (funvar ->
382
384
matchRV.find_metadata var with
383
385
|Some (Local _) whennot (pass_to_callee fundec any_local_reachable var) -> true(* keep caller locals, provided they were not passed to the function *)
384
386
|Some (Arg _) -> true(* keep caller args *)
387
+
|Some ((Local_ | Global_)) whennot (RD.mem_var new_fun_rel var) -> false(* remove locals and globals, for which no record exists in the new_fun_apr *)
388
+
|Some ((Localv | Globalv)) whennot (TaintPartialContexts.VS.mem v tainted_vars) -> true(* keep locals and globals, which have not been touched by the call *)
385
389
|_ -> false(* remove everything else (globals, global privs, reachable things from the caller) *)
(* combine caller's state with globals from callee *)
141
144
(* TODO (precision): globals with only global vars are kept, the rest is lost -> collect which globals are assigned to *)
142
145
(* D.merge (fun k s1 s2 -> match s2 with Some ss2 when (fst k).vglob && D.only_global_exprs ss2 -> s2 | _ when (fst k).vglob -> None | _ -> s1) ctx.local au *)
143
-
D.only_locals ctx.local (* globals might have changed... *)
146
+
let tainted =TaintPartialContexts.conv_varset (f_ask.f Queries.MayBeTainted) in
147
+
D.only_untainted ctx.local tainted (* tainted globals might have changed... *)
let m =D.edit_callstack List.tl m in(* TODO could it be problematic to keep this in the caller instead of callee domain? if we only add the stack for the callee in enter, then there would be no need to pop a location anymore... *)
0 commit comments