diff options
-rw-r--r-- | cparser/Unblock.ml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cparser/Unblock.ml b/cparser/Unblock.ml index d25f70c6..8530ae01 100644 --- a/cparser/Unblock.ml +++ b/cparser/Unblock.ml @@ -31,6 +31,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 |