Skip to content

add region around Texp_probe #2236

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 3 commits into from
Jan 22, 2024
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
2 changes: 1 addition & 1 deletion ocaml/lambda/translcore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ and transl_exp0 ~in_new_scope ~scopes sort e =
probes. *)
~params:(List.map (fun name -> { name; layout = layout_probe_arg; attributes = Lambda.default_param_attribute; mode = alloc_heap }) param_idents)
~return:return_layout
~body
~body:(maybe_region_layout return_layout body)
~loc:(of_location ~scopes exp.exp_loc)
~attr
~mode:alloc_heap
Expand Down
9 changes: 9 additions & 0 deletions tests/backend/probes/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
(deps t1.ml)
(action (run %{bin:ocamlopt.opt} %{deps} -warn-error "+190" -c)))

(rule
(alias runtest)
(enabled_if
(and (= %{context_name} "main")
(= %{system} "linux")
(= %{architecture} "amd64")))
(deps region.ml)
(action (run %{bin:ocamlopt.opt} %{deps} -c)))

(executable
(name t2)
(modules t2))
Expand Down
6 changes: 6 additions & 0 deletions tests/backend/probes/region.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(* minimal BUG example from alanechang *)
let _ =
(fun f -> [%probe "" (
let local_ a = "abc" in
f a; ()
)]) (fun x -> ())