aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2018-05-02 10:04:52 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2018-05-02 10:04:52 +0200
commite224022a4887029ed099a265a8e3c71c84d67556 (patch)
tree4bf9435959de777ad520ab6768fe8293c3e14012
parent37a609c01f48883b68500571fa2559e9932ecfa1 (diff)
downloadcompcert-kvx-e224022a4887029ed099a265a8e3c71c84d67556.tar.gz
compcert-kvx-e224022a4887029ed099a265a8e3c71c84d67556.zip
Reject arrays of incomplete type (#90)
The type of array elements must be complete. Bug 23341
-rw-r--r--cparser/Elab.ml2
1 files changed, 2 insertions, 0 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml
index beb3e3cf..1b87c095 100644
--- a/cparser/Elab.ml
+++ b/cparser/Elab.ml
@@ -685,6 +685,8 @@ and elab_type_declarator keep_ty loc env ty kr_ok = function
| Cabs.ARRAY(d, cv_specs, sz) ->
let (ty, a) = get_nontype_attrs env ty in
let a = add_attributes a (elab_cvspecs env cv_specs) in
+ if wrap incomplete_type loc env ty then
+ error loc "array type has incomplete element type %a" (print_typ env) ty;
let sz' =
match sz with
| None ->