Skip to content

Commit

Permalink
Revert "Error reporting: better call stack (#11957)"
Browse files Browse the repository at this point in the history
This reverts commit 21f63d1.
CI is using an older build atm, this test cannot work
  • Loading branch information
kLabz committed Jan 30, 2025
1 parent aa459e4 commit 02e6e55
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 12 deletions.
9 changes: 1 addition & 8 deletions src/macro/eval/evalExceptions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,8 @@ let catch_exceptions ctx ?(final=(fun() -> ())) f p =
| _ ->
(if p' = null_pos then p else p'),stack
in
let stack = List.fold_left (fun stack p -> match stack with
| (hd,n) :: stack when hd = p -> (hd,n+1) :: stack
| stack -> (p,1) :: stack
) [] stack in
Error.raise_error (Error.make_error
~sub:(List.map (fun (p, n) ->
let suf = if n > 1 then (Printf.sprintf " (%i times)" n) else "" in
Error.make_error (Error.Custom ("Called from here" ^ suf)) p
) stack)
~sub:(List.map (fun p -> Error.make_error (Error.Custom "Called from here") p) (List.rev stack))
(Error.Custom ("Uncaught exception " ^ (value_string v)))
p
)
Expand Down
20 changes: 18 additions & 2 deletions tests/misc/projects/Issue8303/compile-fail.hxml.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
Main.hx:1: character 1 : Uncaught exception Stack overflow
Main.hx:8: characters 4-9 : Called from here (17 times)
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:10: characters 3-8 : Called from here
Main.hx:3: characters 3-9 : Called from here
Main.hx:3: characters 3-9 : Called from here
18 changes: 17 additions & 1 deletion tests/misc/projects/Issue8303/indent-fail.hxml.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
Main.hx:1: character 1 : Uncaught exception Stack overflow
Main.hx:8: characters 4-9 : Called from here (17 times)
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:8: characters 4-9 : Called from here
Main.hx:10: characters 3-8 : Called from here
Main.hx:3: characters 3-9 : Called from here
34 changes: 33 additions & 1 deletion tests/misc/projects/Issue8303/pretty-fail.hxml.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,39 @@

8 | log();
| ^^^^^
| Called from here (17 times)
| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

| Called from here

10 | log();
| ^^^^^
Expand Down

0 comments on commit 02e6e55

Please sign in to comment.