Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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