diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-12-07 16:03:17 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-12-07 16:03:17 +0100 |
commit | 0c73ba202a910d5ab2ae900a56264fc1534f0214 (patch) | |
tree | 0e7fe704111bec0404916c3b88d02138fadc9b32 /cparser/Cutil.ml | |
parent | 680444f180c750078a77b0591cd5c19e632612d6 (diff) | |
download | compcert-0c73ba202a910d5ab2ae900a56264fc1534f0214.tar.gz compcert-0c73ba202a910d5ab2ae900a56264fc1534f0214.zip |
Next try for support of anonymous structs.
Instead of using idents the anonymous fileds get names of the
for <anon>_c where c is a counter of all anonymous members.
Bug 20003
Diffstat (limited to 'cparser/Cutil.ml')
-rw-r--r-- | cparser/Cutil.ml | 9 |
1 files changed, 5 insertions, 4 deletions
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 |