Skip to content

Add missing location in wrapper functions #2432

New issue

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

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

Already on GitHub? # to your account

Merged
merged 3 commits into from
Apr 12, 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/simplif.ml
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ let split_default_wrapper ~id:fun_id ~kind ~params ~return ~body
ap_func = Lvar inner_id;
ap_args = args;
ap_result_layout = return;
ap_loc = Loc_unknown;
ap_loc = loc;
ap_region_close = Rc_normal;
ap_mode = alloc_heap;
ap_tailcall = Default_tailcall;
Expand Down
4 changes: 4 additions & 0 deletions ocaml/testsuite/tests/backtrace/backtrace_or_exception.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
(* TEST
flags = "-g"
ocamlrunparam += ",b=1"
* bytecode
reference = "${test_source_directory}/backtrace_or_exception.reference"
* native
reference = "${test_source_directory}/backtrace_or_exception.opt.reference"
*)

exception Exn
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
exception Backtrace_or_exception.Exn
Raised at Backtrace_or_exception.without_reraise in file "backtrace_or_exception.ml", line 23, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 43, characters 6-10
---------------------------
exception Backtrace_or_exception.Exn
Raised at Backtrace_or_exception.without_reraise in file "backtrace_or_exception.ml", line 23, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 43, characters 6-10
Re-raised at Backtrace_or_exception.return_exn in file "backtrace_or_exception.ml", line 14, characters 4-13
Called from Backtrace_or_exception.return_exn in file "backtrace_or_exception.ml" (inlined), line 12, characters 15-101
Called from Backtrace_or_exception.with_reraise in file "backtrace_or_exception.ml", line 27, characters 8-44
Re-raised at Backtrace_or_exception.with_reraise in file "backtrace_or_exception.ml", line 30, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 43, characters 6-10
---------------------------
exception Backtrace_or_exception.Exn
Raised at Backtrace_or_exception.trickier in file "backtrace_or_exception.ml", line 39, characters 6-15
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 43, characters 6-10
---------------------------
20 changes: 10 additions & 10 deletions ocaml/testsuite/tests/backtrace/backtrace_or_exception.reference
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
exception Backtrace_or_exception.Exn
Raised at Backtrace_or_exception.without_reraise in file "backtrace_or_exception.ml", line 19, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 39, characters 6-10
Raised at Backtrace_or_exception.without_reraise in file "backtrace_or_exception.ml", line 23, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 43, characters 6-10
---------------------------
exception Backtrace_or_exception.Exn
Raised at Backtrace_or_exception.without_reraise in file "backtrace_or_exception.ml", line 19, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 39, characters 6-10
Re-raised at Backtrace_or_exception.return_exn in file "backtrace_or_exception.ml", line 10, characters 4-13
Called from Backtrace_or_exception.with_reraise in file "backtrace_or_exception.ml", line 23, characters 8-44
Re-raised at Backtrace_or_exception.with_reraise in file "backtrace_or_exception.ml", line 26, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 39, characters 6-10
Raised at Backtrace_or_exception.without_reraise in file "backtrace_or_exception.ml", line 23, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 43, characters 6-10
Re-raised at Backtrace_or_exception.return_exn in file "backtrace_or_exception.ml", line 14, characters 4-13
Called from Backtrace_or_exception.with_reraise in file "backtrace_or_exception.ml", line 27, characters 8-44
Re-raised at Backtrace_or_exception.with_reraise in file "backtrace_or_exception.ml", line 30, characters 4-13
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 43, characters 6-10
---------------------------
exception Backtrace_or_exception.Exn
Raised at Backtrace_or_exception.trickier in file "backtrace_or_exception.ml", line 35, characters 6-15
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 39, characters 6-10
Raised at Backtrace_or_exception.trickier in file "backtrace_or_exception.ml", line 39, characters 6-15
Called from Backtrace_or_exception.run in file "backtrace_or_exception.ml", line 43, characters 6-10
---------------------------
6 changes: 3 additions & 3 deletions tests/backend/checkmach/t1.output
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
File "t1.ml", line 6, characters 7-17:
Error: Annotation check for zero_alloc failed on function T1.Params.test12 (camlT1.test12_HIDE_STAMP)

File "_none_", line 1:
Error: called function may allocate (indirect tailcall)

File "t1.ml", line 6, characters 31-45:
Error: allocation of 24 bytes

File "t1.ml", lines 6-7, characters 26-12:
Error: called function may allocate (indirect tailcall)