Skip to content

Commit

Permalink
Fix two bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierNicole committed Sep 19, 2023
1 parent eb65ba4 commit 8b15784
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion compiler/lib/driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,19 @@ let phi p =

let ( +> ) f g x = g (f x)

let map_triple_fst f (x, y, z) = f x, y, z

let effects p =
if Config.Flag.effects ()
then (
if debug () then Format.eprintf "Effects...@.";
p |> Deadcode.f +> Effects.f)
p
|> Deadcode.f
+> Effects.f
+>
if Config.Flag.double_translation ()
then Fun.id
else map_triple_fst Lambda_lifting.f)
else
( p
, (Code.Var.Set.empty : Effects.cps_calls)
Expand Down
2 changes: 1 addition & 1 deletion compiler/lib/generate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ let apply_fun_raw =
bounce to a trampoline if needed, to avoid a stack overflow.
The trampoline then performs the call in an shorter stack. *)
let f =
if single_version
if single_version && Config.Flag.double_translation ()
then J.(EObj [ Property (PNS (Utf8_string.of_string_exn "cps"), f) ])
else f
in
Expand Down

0 comments on commit 8b15784

Please sign in to comment.