From 800017c36c15774bdcc7dc5b318fa9606caa4170 Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Wed, 11 Jan 2023 12:21:21 +0100 Subject: Elaboration of compound initializers: reverse list of generated global variables So as to respect dependency order when compound initializers are nested. Fixes: #471 --- cparser/Unblock.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cparser/Unblock.ml b/cparser/Unblock.ml index 32e09399..8a34db30 100644 --- a/cparser/Unblock.ml +++ b/cparser/Unblock.ml @@ -360,7 +360,7 @@ let unblock_decl env ((sto, id, ty, optinit) as d) = | Some init -> global_variables := []; let init' = expand_init false env init in - let decls = !global_variables in + let decls = List.rev !global_variables in global_variables := []; decls @ [(sto, id, ty, Some init')] -- cgit