Skip to content

Commit 3e89296

Browse files
committed
Preserve backwards compatibility in elixir_erl, closes #14323
1 parent 98080d9 commit 3e89296

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/elixir/src/elixir_erl_try.erl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ reduce_clauses([], Acc, OldStack, SAcc, _S) ->
2424
{lists:reverse(Acc), SAcc#elixir_erl{stacktrace=OldStack}}.
2525

2626
each_clause({'catch', Meta, Raw, Expr}, S) ->
27-
{Match, Guards} = elixir_utils:extract_splat_guards(Raw),
27+
{Args, Guards} = elixir_utils:extract_splat_guards(Raw),
28+
29+
Match =
30+
%% Elixir v1.17 and earlier emitted single argument
31+
%% and may still be processed via debug_info
32+
case Args of
33+
[X] -> [throw, X];
34+
[X, Y] -> [X, Y]
35+
end,
2836

2937
{{clause, Line, [TKind, TMatches], TGuards, TBody}, TS} =
3038
elixir_erl_clauses:clause(?ann(Meta), fun elixir_erl_pass:translate_args/3, Match, Expr, Guards, S),

0 commit comments

Comments
 (0)