Skip to content

Commit

Permalink
Remove CfgTools dependency on IntDomain via Offset
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Dec 6, 2023
1 parent b5f6272 commit 036a016
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cdomains/offset.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct
include CilType.Exp
let name () = "exp index"

let any = CastE (TInt (Cilfacade.ptrdiff_ikind (), []), mkString "any_index")
let any = Cilfacade.any_index_exp
let all = CastE (TInt (Cilfacade.ptrdiff_ikind (), []), mkString "all_index")

(* Override output *)
Expand Down
8 changes: 7 additions & 1 deletion src/common/util/cilfacade.ml
Original file line number Diff line number Diff line change
Expand Up @@ -706,4 +706,10 @@ let add_function_declarations (file: Cil.file): unit =
in
let fun_decls = List.filter_map declaration_from_GFun functions in
let globals = upto_last_type @ fun_decls @ non_types @ functions in
file.globals <- globals
file.globals <- globals


(** Special index expression for some unknown index.
Weakly updates array in assignment.
Used for [exp.fast_global_inits]. *)
let any_index_exp = CastE (TInt (ptrdiff_ikind (), []), mkString "any_index")
2 changes: 1 addition & 1 deletion src/framework/cfgTools.ml
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ let getGlobalInits (file: file) : edges =
lval
in
let rec any_index_offset = function
| Index (e,o) -> Index (Offset.Index.Exp.any, any_index_offset o)
| Index (e,o) -> Index (Cilfacade.any_index_exp, any_index_offset o)
| Field (f,o) -> Field (f, any_index_offset o)
| NoOffset -> NoOffset
in
Expand Down

0 comments on commit 036a016

Please sign in to comment.