Skip to content

Commit 8115bd3

Browse files
committed
Preserve backwards compatibility in elixir_erl, closes #14323
1 parent e35ffc5 commit 8115bd3

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
@@ -20,7 +20,15 @@ reduce_clauses([], Acc, OldStack, SAcc, _S) ->
2020
{lists:reverse(Acc), SAcc#elixir_erl{stacktrace=OldStack}}.
2121

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

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

0 commit comments

Comments
 (0)