diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2015-11-09 17:03:47 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2015-11-09 17:03:47 +0100 |
commit | 35e3f39bf967c4ed2ba3390b488604554306065d (patch) | |
tree | 6ec4f40aab63e818693786145de937ef7a2870eb /cparser/Unblock.ml | |
parent | e79e6fe5e4da4cf4c9852456f5ad82e633551cc9 (diff) | |
download | compcert-kvx-35e3f39bf967c4ed2ba3390b488604554306065d.tar.gz compcert-kvx-35e3f39bf967c4ed2ba3390b488604554306065d.zip |
Handle large static initializers for global arrays
Use tail-recursive operations to implement transformations on initializers for global arrays. This way, very large static initializers no longer cause stack overflows at compile-time.
Diffstat (limited to 'cparser/Unblock.ml')
-rw-r--r-- | cparser/Unblock.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cparser/Unblock.ml b/cparser/Unblock.ml index 405cf755..ef8bc91c 100644 --- a/cparser/Unblock.ml +++ b/cparser/Unblock.ml @@ -169,7 +169,7 @@ and expand_init islocal env i = | Init_single e -> Init_single (expand_expr islocal env e) | Init_array il -> - Init_array (List.map expand il) + Init_array (List.rev (List.rev_map expand il)) | Init_struct(id, flds) -> Init_struct(id, List.map (fun (f, i) -> (f, expand i)) flds) | Init_union(id, fld, i) -> |