Skip to content

Double translation: fix stack overflow issue #1869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* Runtime: fix path normalization (#1848)
* Runtime: fix reading from the pseudo-filesystem (#1859)
* Runtime: fix initialization of standard streams under Windows (#1849)
* Compiler: fix stack overflow issues with double translation (#1869)

# 6.0.1 (2025-02-07) - Lille

Expand Down
9 changes: 2 additions & 7 deletions compiler/lib/driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ let map_fst f (x, y, z) = f x, y, z

let effects ~deadcode_sentinal p =
match Config.effects () with
| (`Cps | `Double_translation) as effects ->
| `Cps | `Double_translation ->
if debug () then Format.eprintf "Effects...@.";
let p, live_vars = Deadcode.f p in
let p = Effects.remove_empty_blocks ~live_vars p in
Expand All @@ -112,12 +112,7 @@ let effects ~deadcode_sentinal p =
Deadcode.f p
else p, live_vars
in
p
|> Effects.f ~flow_info:info ~live_vars
|> map_fst
(match effects with
| `Double_translation -> Fun.id
| `Cps -> Lambda_lifting.f)
p |> Effects.f ~flow_info:info ~live_vars |> map_fst Lambda_lifting.f
| `Disabled | `Jspi ->
( p
, (Code.Var.Set.empty : Effects.trampolined_calls)
Expand Down
13 changes: 1 addition & 12 deletions tools/dune
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
(executable
(name node_wrapper)
(modules node_wrapper node_wrapper_per_profile)
(modules node_wrapper)
(libraries unix))

(executable
(name gen_node_wrapper_per_profile)
(modules gen_node_wrapper_per_profile))

(rule
(target node_wrapper_per_profile.ml)
(action
(with-stdout-to
%{target}
(run ./gen_node_wrapper_per_profile.exe %{profile}))))

(executable
(name ci_setup)
(modules ci_setup)
Expand Down
12 changes: 0 additions & 12 deletions tools/gen_node_wrapper_per_profile.ml

This file was deleted.

2 changes: 1 addition & 1 deletion tools/node_wrapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let extra_args_for_wasoo =
; "--stack-size=10000"
]

let extra_args_for_jsoo = [] @ Node_wrapper_per_profile.args
let extra_args_for_jsoo = []

let env = Unix.environment ()

Expand Down
Loading