Skip to content

Commit

Permalink
Fixed a miss in ocaml#470 (ocaml#502)
Browse files Browse the repository at this point in the history
fixed potential not found error due to a miss in substitution
  • Loading branch information
Keryan-dev committed Jun 30, 2021
1 parent a7e049a commit 9b68758
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions middle_end/flambda/from_lambda/closure_conversion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,11 @@ let close_functions acc external_env function_declarations =
let function_decls = Function_declarations.create funs in
let closure_elements =
Ident.Map.fold (fun id var_within_closure map ->
let external_var = Simple.var (Env.find_var external_env id) in
Var_within_closure.Map.add var_within_closure external_var map)
let external_simple = find_simple_from_id external_env id in
(* We're sure [external_simple] is a variable since
[var_within_closure_from_idents] has already filtered
constants and symbols out. *)
Var_within_closure.Map.add var_within_closure external_simple map)
var_within_closures_from_idents
Var_within_closure.Map.empty
in
Expand Down

0 comments on commit 9b68758

Please sign in to comment.