Skip to content

Commit

Permalink
Merge pull request #86 from goblint/merge_inline_invariant
Browse files Browse the repository at this point in the history
Merging: Treat inlines as if they were static when mergeInlines is off
  • Loading branch information
michael-schwarz authored Mar 28, 2022
2 parents 07993f3 + bc9a707 commit 6998436
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 185 deletions.
6 changes: 6 additions & 0 deletions src/check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ let varIdsEnv: (int, varinfo) H.t = H.create 117
* identifiers *)
let allVarIds: (int, varinfo) H.t = H.create 117

let fundecForVarIds: (int,unit) H.t = H.create 117

(* Also keep a list of environments. We place an empty string in the list to
* mark the start of a local environment (i.e. a function) *)
let varNamesList : (string * int) list ref = ref []
Expand Down Expand Up @@ -961,6 +963,9 @@ let rec checkGlobal = function
(* Check if this is the first occurrence *)
let vi = fd.svar in
let fname = vi.vname in
if H.mem fundecForVarIds vi.vid then
ignore (warn "There already is a different fundec for vid %d (%s)" vi.vid vi.vname);

E.withContext (fun _ -> dprintf "GFun(%s)" fname)
(fun _ ->
checkGlobal (GVarDecl (vi, l));
Expand Down Expand Up @@ -1072,6 +1077,7 @@ let checkFile flags fl =
H.clear varNamesEnv;
H.clear varIdsEnv;
H.clear allVarIds;
H.clear fundecForVarIds;
H.clear compNames;
H.clear compUsed;
H.clear enumUsed;
Expand Down
Loading

0 comments on commit 6998436

Please sign in to comment.