Skip to content

Commit

Permalink
[sledge] Disable creating of summaries when summaries disabled
Browse files Browse the repository at this point in the history
Summary:
Fix a bug where summaries would be created even if summarisation option
is disabled.

Reviewed By: jvillard

Differential Revision: D16259761

fbshipit-source-id: f7319ef03
  • Loading branch information
kren1 authored and facebook-github-bot committed Jul 15, 2019
1 parent a504a67 commit 5882c49
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions sledge/src/control.ml
Original file line number Diff line number Diff line change
Expand Up @@ -315,19 +315,25 @@ let exec_return ~opts stk pre_state (block : Llair.block) exp globals =
| None, None -> pre_state
| _ -> violates Llair.Func.invariant block.parent
in
let globals =
Var.Set.of_vector
(Vector.map globals ~f:(fun (g : Global.t) -> g.var))
in
let function_summary, exit_state =
Domain.create_summary ~locals:block.parent.locals exit_state
~formals:
(Set.union (Var.Set.of_list block.parent.entry.params) globals)
let exit_state =
if opts.function_summaries then (
let globals =
Var.Set.of_vector
(Vector.map globals ~f:(fun (g : Global.t) -> g.var))
in
let function_summary, exit_state =
Domain.create_summary ~locals:block.parent.locals exit_state
~formals:
(Set.union
(Var.Set.of_list block.parent.entry.params)
globals)
in
Hashtbl.add_multi summary_table ~key:block.parent.name.var
~data:function_summary ;
pp_st () ;
exit_state )
else exit_state
in
if opts.function_summaries then (
Hashtbl.add_multi summary_table ~key:block.parent.name.var
~data:function_summary ;
pp_st () ) ;
let post_state =
Domain.post block.parent.locals from_call exit_state
in
Expand Down

0 comments on commit 5882c49

Please sign in to comment.