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

[kernel] Fix identification of enums in ast diff

same issue as with compinfo
parent a415b355
No related branches found
No related tags found
No related merge requests found
......@@ -362,12 +362,12 @@ let find_candidate_compinfo ?loc:_loc ci =
let find_candidate_enuminfo ?loc:_loc ei =
if Globals.Types.mem_type Logic_typing.Enum ei.ename then begin
match Globals.Types.global Logic_typing.Enum ei.ename with
| GEnumTag(ei,_) | GEnumTagDecl(ei,_) -> Some ei
| g ->
match Globals.Types.find_type Logic_typing.Enum ei.ename with
| TEnum(ei,_) -> Some ei
| t ->
Kernel.fatal
"Expected enumeration definition instead of %a"
Cil_datatype.Global.pretty g
"Expected enuminfo instead of %a"
Printer.pp_typ t
end else None
let find_candidate_varinfo ?loc:_loc vi where =
......
......@@ -77,4 +77,6 @@ struct s;
extern struct s s;
struct s* use_s() { return &s; }
enum e;
struct s* use_s() { enum e* x; return &s; }
......@@ -70,4 +70,6 @@ void local_var_use(int w, int q[][w]) {
extern struct s s;
struct s* use_s() { return &s; }
enum e;
struct s* use_s() { enum e* x; return &s; }
......@@ -9,6 +9,7 @@
[AST diff test] Variable y: => t
[AST diff test] Variable s: => s
[AST diff test] Variable use_s: => use_s
[AST diff test] Variable x: => x
[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
......
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