Skip to content

Commit 73cd135

Browse files
committed
Add commented out possible fix to unsound var_eq invalidate
1 parent d239760 commit 73cd135

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/analyses/varEq.ml

+6-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,10 @@ struct
402402
| None -> None
403403
| Some st ->
404404
let vs = ask.f (Queries.ReachableFrom e) in
405-
Some (Queries.LS.join vs st)
405+
if Queries.LS.is_top vs then
406+
None
407+
else
408+
Some (Queries.LS.join vs st)
406409
in
407410
List.fold_right reachable es (Some (Queries.LS.empty ()))
408411

@@ -496,6 +499,8 @@ struct
496499
D.B.fold remove_reachable2 es st
497500
in
498501
D.fold remove_reachable1 ctx.local ctx.local
502+
(* TODO: do something like this instead to be sound? *)
503+
(* List.fold_left (fun st e -> remove_exp (Analyses.ask_of_ctx ctx) e st) ctx.local (Queries.LS.fold (fun lval acc -> mkAddrOf (Lval.CilLval.to_lval lval) :: acc) rs []) *)
499504

500505
let unknown_fn ctx lval f args =
501506
let args =

0 commit comments

Comments
 (0)