Skip to content

Commit

Permalink
Use Cil.isIntegralType in constants analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Oct 28, 2024
1 parent 9a8dd4e commit 28dc22b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/analyses/tutorials/constants.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ struct
(* No contexts *)
include Analyses.IdentityUnitContextsSpec

let is_integer_var (v: varinfo) =
match v.vtype with
| TInt _ -> true
| _ -> false

let get_local = function
| Var v, NoOffset when is_integer_var v && not (v.vglob || v.vaddrof) -> Some v (* local integer variable whose address is never taken *)
| Var v, NoOffset when isIntegralType v.vtype && not (v.vglob || v.vaddrof) -> Some v (* local integer variable whose address is never taken *)
| _, _ -> None

(** Evaluates expressions *)
Expand Down

0 comments on commit 28dc22b

Please sign in to comment.