aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Checks.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2017-02-08 10:50:47 +0100
committerBernhard Schommer <bschommer@users.noreply.github.com>2017-02-17 14:09:56 +0100
commit02ce352d5f402e43afde51337444b6cd13f06d7e (patch)
tree74ed76414c4d2d169abd3f523ceb333488dea055 /cparser/Checks.ml
parentd0778a80e625cc4a057cc6acf66e58abff13cb46 (diff)
downloadcompcert-kvx-02ce352d5f402e43afde51337444b6cd13f06d7e.tar.gz
compcert-kvx-02ce352d5f402e43afde51337444b6cd13f06d7e.zip
Also check the locals. Bug 19872.
Diffstat (limited to 'cparser/Checks.ml')
-rw-r--r--cparser/Checks.ml10
1 files changed, 7 insertions, 3 deletions
diff --git a/cparser/Checks.ml b/cparser/Checks.ml
index c64e1a12..434efea0 100644
--- a/cparser/Checks.ml
+++ b/cparser/Checks.ml
@@ -35,6 +35,9 @@ let unknown_attrs_typ env loc ty =
let attr = attributes_of_type env ty in
unknown_attrs loc attr
+let unknown_attrs_decl env loc (sto, id, ty, init) =
+ unknown_attrs_typ env loc ty
+
let rec unknown_attrs_stmt env s =
match s.sdesc with
| Sskip
@@ -57,7 +60,7 @@ let rec unknown_attrs_stmt env s =
| Sdowhile (s,_)
| Sswitch (_,s) -> unknown_attrs_stmt env s
| Sblock sl -> List.iter (unknown_attrs_stmt env) sl
- | Sdecl (sto,id,ty,init) -> unknown_attrs_typ env s.sloc ty
+ | Sdecl d -> unknown_attrs_decl env s.sloc d
let unknown_attrs_program p =
let rec transf_globdecls env = function
@@ -65,12 +68,13 @@ let unknown_attrs_program p =
| g :: gl ->
let env' =
match g.gdesc with
- | Gdecl (sto, id, ty, init) ->
- unknown_attrs_typ env g.gloc ty;
+ | Gdecl ((sto, id, ty, init) as d) ->
+ unknown_attrs_decl env g.gloc d;
Env.add_ident env id sto ty
| Gfundef f ->
unknown_attrs g.gloc f.fd_attrib;
unknown_attrs_stmt env f.fd_body;
+ List.iter (unknown_attrs_decl env g.gloc) f.fd_locals;
Env.add_ident env f.fd_name f.fd_storage (fundef_typ f)
| Gcompositedecl(su, id, attr) ->
Env.add_composite env id (composite_info_decl su attr)