Skip to content

Commit

Permalink
Don't warn for non-local vars in address set if they're globals
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstanb committed Oct 4, 2023
1 parent 2c883eb commit 5cb10f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/analyses/base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ struct
(* Warn if any of the addresses contains a non-local variable *)
AD.iter (function
| AD.Addr.Addr (v,o) ->
if not @@ CPA.mem v st.cpa then (
if not (CPA.mem v st.cpa) && not (is_global a v) then (
(* TODO: Not the smartest move to set the global flag within an iter *)
(* TODO: We can resort to using AD.exists instead *)
AnalysisStateUtil.set_mem_safety_flag InvalidDeref;
Expand Down

0 comments on commit 5cb10f6

Please sign in to comment.