aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Unblock.ml
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2021-06-01 14:37:07 +0200
committerCyril SIX <cyril.six@kalray.eu>2021-06-01 14:37:07 +0200
commit5a632954c85e8b2b5afea124e4fc83f39c5d3598 (patch)
treed53323083adec47d3338a04b516265c634806bea /cparser/Unblock.ml
parenta298e55fdc51cce92a8b39280643b623d7d991a8 (diff)
downloadcompcert-kvx-5a632954c85e8b2b5afea124e4fc83f39c5d3598.tar.gz
compcert-kvx-5a632954c85e8b2b5afea124e4fc83f39c5d3598.zip
[BROKEN] Merge with v3.9 : something broken for __builtin_expect in cfrontend/C2C.ml
Diffstat (limited to 'cparser/Unblock.ml')
-rw-r--r--cparser/Unblock.ml12
1 files changed, 8 insertions, 4 deletions
diff --git a/cparser/Unblock.ml b/cparser/Unblock.ml
index d25f70c6..4b1f2262 100644
--- a/cparser/Unblock.ml
+++ b/cparser/Unblock.ml
@@ -6,10 +6,11 @@
(* *)
(* Copyright Institut National de Recherche en Informatique et en *)
(* Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the GNU General Public License as published by *)
-(* the Free Software Foundation, either version 2 of the License, or *)
-(* (at your option) any later version. This file is also distributed *)
-(* under the terms of the INRIA Non-Commercial License Agreement. *)
+(* under the terms of the GNU Lesser General Public License as *)
+(* published by the Free Software Foundation, either version 2.1 of *)
+(* the License, or (at your option) any later version. *)
+(* This file is also distributed under the terms of the *)
+(* INRIA Non-Commercial License Agreement. *)
(* *)
(* *********************************************************************)
@@ -31,6 +32,9 @@ let rec local_initializer env path init k =
let (ty_elt, sz) =
match unroll env path.etyp with
| TArray(ty_elt, Some sz, _) -> (ty_elt, sz)
+ (* We accept empty array initializer for flexible array members, which
+ has size zero *)
+ | TArray(ty_elt, None, _) when il = [] -> (ty_elt, 0L)
| _ -> Diagnostics.fatal_error Diagnostics.no_loc "wrong type for array initializer" in
let rec array_init pos il =
if pos >= sz then k else begin