aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cutil.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2016-12-27 19:50:01 +0100
committerGitHub <noreply@github.com>2016-12-27 19:50:01 +0100
commit9b022d749dc5b1fdb091ff8a74647c03fc1f84bb (patch)
tree24218347dd375ebdf36789659a5fd092cc8aa575 /cparser/Cutil.ml
parent647cc8dc9699277cb1e77ae3b07c007186720d59 (diff)
parent860f28734063628f5582be91c7429b14f0922917 (diff)
downloadcompcert-9b022d749dc5b1fdb091ff8a74647c03fc1f84bb.tar.gz
compcert-9b022d749dc5b1fdb091ff8a74647c03fc1f84bb.zip
Merge pull request #153 from AbsInt/anonymous_struct2
Next try for support of anonymous structs.
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