Skip to content

Commit

Permalink
Add eval_offset tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Sep 26, 2023
1 parent 810fab5 commit 5347c08
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cdomains/valueDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ struct
(* Funny, this does not compile without the final type annotation! *)
let rec eval_offset (ask: VDQ.t) f (x: t) (offs:offs) (exp:exp option) (v:lval option) (t:typ): t =
let rec do_eval_offset (ask:VDQ.t) f (x:t) (offs:offs) (exp:exp option) (l:lval option) (o:offset option) (v:lval option) (t:typ): t =
if M.tracing then M.traceli "eval_offset" "do_eval_offset %a %a (%a)\n" pretty x Offs.pretty offs (Pretty.docOpt (CilType.Exp.pretty ())) exp;
let r =
match x, offs with
| Blob((va, _, orig) as c), `Index (_, ox) ->
begin
Expand Down Expand Up @@ -886,6 +888,9 @@ struct
| Top -> M.info ~category:Imprecise "Trying to read an index, but the array is unknown"; top ()
| _ -> M.warn ~category:Imprecise ~tags:[Category Program] "Trying to read an index, but was not given an array (%a)" pretty x; top ()
end
in
if M.tracing then M.traceu "eval_offset" "do_eval_offset -> %a\n" pretty r;
r
in
let l, o = match exp with
| Some(Lval (x,o)) -> Some ((x, NoOffset)), Some(o)
Expand Down

0 comments on commit 5347c08

Please sign in to comment.