Skip to content
Snippets Groups Projects
Commit 389923a1 authored by David Bühler's avatar David Bühler
Browse files

[kernel] Ast_diff: checks the type of corresponding global variables.

parent 5a672370
No related branches found
No related tags found
No related merge requests found
...@@ -1249,8 +1249,6 @@ and is_same_fundec f f' env: body_correspondance = ...@@ -1249,8 +1249,6 @@ and is_same_fundec f f' env: body_correspondance =
| `Body_changed -> ()); | `Body_changed -> ());
res res
(* only for locals and formals. Globals are treated by
gvar_correspondance below. *)
and is_same_varinfo vi vi' env = and is_same_varinfo vi vi' env =
is_same_type vi.vtype vi'.vtype env && is_same_type vi.vtype vi'.vtype env &&
Cil_datatype.Attributes.equal vi.vattr vi'.vattr Cil_datatype.Attributes.equal vi.vattr vi'.vattr
...@@ -1373,13 +1371,16 @@ and gvar_correspondance ?loc vi env = ...@@ -1373,13 +1371,16 @@ and gvar_correspondance ?loc vi env =
end end
| None -> `Not_present | None -> `Not_present
| Some vi' -> | Some vi' ->
let selection = State_selection.singleton Globals.Vars.self in if is_same_varinfo vi vi' env
let init = then
Project.on ~selection (Orig_project.get()) Globals.Vars.find vi let selection = State_selection.singleton Globals.Vars.self in
in let init =
let init' = Globals.Vars.find vi' in Project.on ~selection (Orig_project.get()) Globals.Vars.find vi
let res = is_same_initinfo init init' empty_env in in
if res then `Same vi' else `Not_present let init' = Globals.Vars.find vi' in
let res = is_same_initinfo init init' empty_env in
if res then `Same vi' else `Not_present
else `Not_present
in in
Varinfo.memo add vi Varinfo.memo add vi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment