File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -397,8 +397,21 @@ struct
397397 (* Probably ok as is. *)
398398 let body man f = man.local
399399
400+ let rec assume ask exp st =
401+ match exp with
402+ | BinOp (Eq , Lval lval, exp, t)
403+ | BinOp (Eq, exp , Lval lval , t ) ->
404+ add_eq ask lval exp st
405+ | BinOp (LAnd, e1 , e2 , _ ) ->
406+ assume ask e2 (assume ask e1 st)
407+ | _ -> st
408+
400409 (* Branch could be improved to set invariants like base tries to do. *)
401- let branch man exp tv = man.local
410+ let branch man exp tv =
411+ if tv then
412+ assume (Analyses. ask_of_man man) exp man.local
413+ else
414+ man.local
402415
403416 (* Just remove things that go out of scope. *)
404417 let return man exp fundec =
@@ -578,6 +591,8 @@ struct
578591 |> List. fold_left (fun st lv ->
579592 remove (Analyses. ask_of_man man) lv st
580593 ) man.local
594+ |> assume (Analyses. ask_of_man man) exp
595+ |> D. join man.local
581596 | Events. Escape vars ->
582597 if EscapeDomain.EscapedVars. is_top vars then
583598 D. top ()
You can’t perform that action at this time.
0 commit comments