Skip to content

Commit

Permalink
Fix indentation in MemLeak
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Nov 27, 2023
1 parent 0e64a8f commit 778d883
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/analyses/memLeak.ml
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ struct
| Malloc _
| Calloc _
| Realloc _ ->
(ctx.sideg () true;
ctx.sideg () true;
begin match ctx.ask (Queries.AllocVar {on_stack = false}) with
| `Lifted var ->
ToppedVarInfoSet.add var state
| _ -> state
end)
end
| Free ptr ->
begin match ctx.ask (Queries.MayPointTo ptr) with
| ad when (not (Queries.AD.is_top ad)) && Queries.AD.cardinal ad = 1 ->
Expand All @@ -233,16 +233,15 @@ struct
| a when Queries.ID.is_bot a -> M.warn ~category:Assert "assert expression %a is bottom" d_exp exp
| a ->
begin match Queries.ID.to_bool a with
| Some b -> (
| Some b ->
(* If we know for sure that the expression in "assert" is false => need to check for memory leaks *)
if b = false then (
warn_for_multi_threaded_due_to_abort ctx;
check_for_mem_leak ctx
)
else ())
if b = false then (

This comment has been minimized.

Copy link
@michael-schwarz

michael-schwarz Nov 28, 2023

Member

This is weird. Why not:

| Some true -> ()
| Some false -> ...
| None -> ...

This comment has been minimized.

Copy link
@sim642

sim642 Nov 29, 2023

Author Member

Indeed, I changed it to that in 30daf27.

warn_for_multi_threaded_due_to_abort ctx;
check_for_mem_leak ctx
)
| None ->
(warn_for_multi_threaded_due_to_abort ctx;
check_for_mem_leak ctx ~assert_exp_imprecise:true ~exp:(Some exp))
warn_for_multi_threaded_due_to_abort ctx;
check_for_mem_leak ctx ~assert_exp_imprecise:true ~exp:(Some exp)
end
in
warn_for_assert_exp;
Expand Down

0 comments on commit 778d883

Please sign in to comment.