diff --git a/middle_end/flambda/from_lambda/closure_conversion_aux.ml b/middle_end/flambda/from_lambda/closure_conversion_aux.ml index 449e675ca19a..49ff36456e06 100644 --- a/middle_end/flambda/from_lambda/closure_conversion_aux.ml +++ b/middle_end/flambda/from_lambda/closure_conversion_aux.ml @@ -112,6 +112,10 @@ module Env = struct let clear_local_bindings { variables = _; globals; simples_to_substitute; backend; current_unit_id; symbol_for_global'; } = + let simples_to_substitute = + Ident.Map.filter (fun _ simple -> not (Simple.is_var simple)) + simples_to_substitute + in { variables = Ident.Map.empty; globals; simples_to_substitute;