diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-03-18 10:31:11 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-03-18 10:31:11 +0000 |
commit | c4f1ca931fe19f7e8e67cca6bb56dd867770d1d0 (patch) | |
tree | 704d1e4f87fa650bcae793d393f9e15853616ef6 /cfrontend/Initializers.v | |
parent | 29f0916efc3381b80d01d26673fe14957d85af5a (diff) | |
download | compcert-c4f1ca931fe19f7e8e67cca6bb56dd867770d1d0.tar.gz compcert-c4f1ca931fe19f7e8e67cca6bb56dd867770d1d0.zip |
Support array initialization lists that are too short
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2432 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/Initializers.v')
-rw-r--r-- | cfrontend/Initializers.v | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cfrontend/Initializers.v b/cfrontend/Initializers.v index 1b339c18..f180f980 100644 --- a/cfrontend/Initializers.v +++ b/cfrontend/Initializers.v @@ -190,8 +190,8 @@ with transl_init_array (ty: type) (il: initializer_list) (sz: Z) {struct il} : res (list init_data) := match il with | Init_nil => - if zeq sz 0 - then OK nil + if zeq sz 0 then OK nil + else if zle 0 sz then OK (Init_space (sz * sizeof ty) :: nil) else Error (msg "wrong number of elements in array initializer") | Init_cons i1 il' => do d1 <- transl_init ty i1; |