Skip to content
Snippets Groups Projects
Commit a415b355 authored by Virgile Prevosto's avatar Virgile Prevosto Committed by David Bühler
Browse files

[kernel] use proper function to find matching compinfo in ast diff

parent 346ed802
No related branches found
No related tags found
No related merge requests found
......@@ -352,12 +352,12 @@ let find_candidate_type ?loc:_loc ti =
let find_candidate_compinfo ?loc:_loc ci =
let su = if ci.cstruct then Logic_typing.Struct else Logic_typing.Union in
if Globals.Types.mem_type su ci.cname then begin
match Globals.Types.global su ci.cname with
| GCompTag (ci,_) | GCompTagDecl(ci,_) -> Some ci
| g ->
match Globals.Types.find_type su ci.cname with
| TComp(ci', _) -> Some ci'
| t ->
Kernel.fatal
"Expected aggregate definition instead of %a"
Cil_datatype.Global.pretty g
"Expected compinfo instead of %a"
Printer.pp_typ t
end else None
let find_candidate_enuminfo ?loc:_loc ei =
......
......@@ -72,3 +72,9 @@ void local_var_use(int v, int a[][v]) {
int x;
int y [sizeof(x)];
}
struct s;
extern struct s s;
struct s* use_s() { return &s; }
......@@ -67,3 +67,7 @@ void local_var_use(int w, int q[][w]) {
int z;
int t [sizeof(z)];
}
extern struct s s;
struct s* use_s() { return &s; }
......@@ -7,10 +7,13 @@
[AST diff test] Variable a: => q
[AST diff test] Variable x: => z
[AST diff test] Variable y: => t
[AST diff test] Variable s: => s
[AST diff test] Variable use_s: => use_s
[AST diff test] Variable has_static_local_x: => has_static_local_y
[AST diff test] Variable X: => X
[AST diff test] Variable Y: N/A
[AST diff test] Variable f: => f
[AST diff test] Variable __retres: => __retres
[AST diff test] Variable x: => x
[AST diff test] Variable g: => g
[AST diff test] Variable h: => h
......@@ -23,6 +26,7 @@
[AST diff test] Variable ptr_func: => ptr_func
[AST diff test] Function i: => i
[AST diff test] Function local_var_use: => local_var_use
[AST diff test] Function use_s: => use_s
[AST diff test] Function f: => f
[AST diff test] Function g: N/A
[AST diff test] Function h: -> h (body changed)
......
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