diff --git a/compiler/minils/transformations/normalize_mem.ml b/compiler/minils/transformations/normalize_mem.ml index be05fc2..bb83348 100644 --- a/compiler/minils/transformations/normalize_mem.ml +++ b/compiler/minils/transformations/normalize_mem.ml @@ -18,7 +18,7 @@ let eq _ (v, eqs) eq = match eq.eq_lhs, eq.eq_rhs.e_desc with let x_copy_exp = mk_exp ty (Eextvalue (mk_extvalue ~ty:ty (Wvar x_copy))) in let eq_copy = { eq with eq_rhs = x_copy_exp } in let eq = { eq with eq_lhs = Evarpat x_copy } in - eq, (vd::v, eq::eq_copy::eqs) + eq, (vd::v, eq_copy::eq::eqs) else eq, (v, eq::eqs) | _, _ -> @@ -26,7 +26,7 @@ let eq _ (v, eqs) eq = match eq.eq_lhs, eq.eq_rhs.e_desc with let node funs acc nd = let nd, (v, eqs) = Mls_mapfold.node_dec funs (nd.n_local, []) nd in - { nd with n_local = v; n_equs = eqs }, acc + { nd with n_local = v; n_equs = List.rev eqs }, acc let program p = let funs = { Mls_mapfold.defaults with eq = eq; node_dec = node } in