aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cutil.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-12-07 16:03:17 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2016-12-07 16:03:17 +0100
commit0c73ba202a910d5ab2ae900a56264fc1534f0214 (patch)
tree0e7fe704111bec0404916c3b88d02138fadc9b32 /cparser/Cutil.ml
parent680444f180c750078a77b0591cd5c19e632612d6 (diff)
downloadcompcert-kvx-0c73ba202a910d5ab2ae900a56264fc1534f0214.tar.gz
compcert-kvx-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.ml9
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