aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_ssa_pre_codegen.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compiler/src/beam_ssa_pre_codegen.erl')
-rw-r--r--lib/compiler/src/beam_ssa_pre_codegen.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_ssa_pre_codegen.erl b/lib/compiler/src/beam_ssa_pre_codegen.erl
index a2e687930b..7ef604d444 100644
--- a/lib/compiler/src/beam_ssa_pre_codegen.erl
+++ b/lib/compiler/src/beam_ssa_pre_codegen.erl
@@ -1472,10 +1472,14 @@ find_loop_exit([L1,L2|_Ls], Blocks) ->
find_loop_exit_1(Path1, cerl_sets:from_list(Path2));
find_loop_exit(_, _) -> none.
+find_loop_exit_1([?BADARG_BLOCK | T], OtherPath) ->
+ %% ?BADARG_BLOCK is a marker and not an actual block, so we can't consider
+ %% it to be a common block even if both paths cross it.
+ find_loop_exit_1(T, OtherPath);
find_loop_exit_1([H|T], OtherPath) ->
case cerl_sets:is_element(H, OtherPath) of
true -> H;
- false -> find_loop_exit_1(T, OtherPath)
+ false -> find_loop_exit_1(T, OtherPath)
end;
find_loop_exit_1([], _) -> none.