Skip to content

Commit

Permalink
Simplify is_not_heap_alloc_var and add TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Oct 2, 2023
1 parent d3347e8 commit 15e6c3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/analyses/base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,8 @@ struct
(* interpreter end *)

let is_not_heap_alloc_var ctx v =
(not (ctx.ask (Queries.IsAllocVar v))) || (ctx.ask (Queries.IsAllocVar v) && not (ctx.ask (Queries.IsHeapVar v)))
let is_alloc = ctx.ask (Queries.IsAllocVar v) in
not is_alloc || (is_alloc && not (ctx.ask (Queries.IsHeapVar v)))

let query_invariant ctx context =
let cpa = ctx.local.BaseDomain.cpa in
Expand Down Expand Up @@ -2114,7 +2115,7 @@ struct
let dest_a, dest_typ = addr_type_of_exp dest in
let value = VD.zero_init_value dest_typ in
set ~ctx (Analyses.ask_of_ctx ctx) gs st dest_a dest_typ value
| Memcpy { dest = dst; src; n; }, _ ->
| Memcpy { dest = dst; src; n; }, _ -> (* TODO: use n *)
memory_copying dst src
(* strcpy(dest, src); *)
| Strcpy { dest = dst; src; n = None }, _ ->
Expand Down

0 comments on commit 15e6c3d

Please sign in to comment.