Skip to content

Commit

Permalink
Compiler: small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Feb 16, 2024
1 parent cc74d94 commit 1a03661
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/lib/freevars.ml
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,16 @@ let f p =
then (
BitSet.set visited pc;
let block = Addr.Map.find pc p.blocks in
List.iter params ~f:(fun x -> Code.Var.ISet.add bound x);
iter_block_bound_vars (fun x -> Code.Var.ISet.add bound x) block;
List.iter args ~f:using;
iter_block_free_vars using block;
List.iter block.body ~f:(function
| Let (_, Closure (_, (pc_clo, _))), _ ->
Code.Var.Set.iter using (Code.Addr.Map.find pc_clo acc)
| _ -> ());
Code.fold_children p.blocks pc (fun pc' () -> traverse pc') ())
in
List.iter params ~f:(fun x -> Code.Var.ISet.add bound x);
List.iter args ~f:using;
traverse pc;
Code.Addr.Map.add pc !free acc)
Code.Addr.Map.empty
Expand Down

0 comments on commit 1a03661

Please sign in to comment.