Skip to content

Commit

Permalink
Don't forget to prepend to acc when collecting globally reachable mem
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstanb committed Nov 19, 2023
1 parent f2ca6d1 commit 0e09d09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/analyses/memLeak.ml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ struct
in
global_struct_ptr_vars
|> List.fold_left (fun acc var ->
if ctx.ask (Queries.IsHeapVar var) then eval_value_of_heap_var var
else if not (ctx.ask (Queries.IsAllocVar var)) && isPointerType var.vtype then get_pts_of_non_heap_ptr_var var
if ctx.ask (Queries.IsHeapVar var) then (eval_value_of_heap_var var) @ acc
else if not (ctx.ask (Queries.IsAllocVar var)) && isPointerType var.vtype then (get_pts_of_non_heap_ptr_var var) @ acc
else acc
) []

Expand Down

0 comments on commit 0e09d09

Please sign in to comment.