From 0c73ba202a910d5ab2ae900a56264fc1534f0214 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 7 Dec 2016 16:03:17 +0100 Subject: Next try for support of anonymous structs. Instead of using idents the anonymous fileds get names of the for _c where c is a counter of all anonymous members. Bug 20003 --- cparser/Cutil.ml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cparser/Cutil.ml') diff --git a/cparser/Cutil.ml b/cparser/Cutil.ml index 4d0cd735..f5d5c425 100644 --- a/cparser/Cutil.ml +++ b/cparser/Cutil.ml @@ -691,10 +691,11 @@ let is_anonymous_composite = function (* Find the info for a field access *) let field_of_dot_access env t m = - match unroll env t with - | TStruct(id, _) -> Env.find_struct_member env (id, m) - | TUnion(id, _) -> Env.find_union_member env (id, m) - | _ -> assert false + let m = match unroll env t with + | TStruct(id, _) -> Env.find_struct_member env (id, m) + | TUnion(id, _) -> Env.find_union_member env (id, m) + | _ -> assert false in + List.hd (List.rev m) let field_of_arrow_access env t m = match unroll env t with -- cgit