aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-07-11 09:28:59 +0200
committerJohn Högberg <[email protected]>2019-07-11 09:29:33 +0200
commitbb3ab56962bae22e40b51dfce18ef37b465087a7 (patch)
treed8f1799082ab79c8041704c291159c21401a050f /lib/compiler/src
parent0ba1c8db3f593736cdffb1f7d4c45ea276ad6d56 (diff)
parentd2c096de3c677c20d4a149bec6a9346aea9ccf4d (diff)
downloadotp-bb3ab56962bae22e40b51dfce18ef37b465087a7.tar.gz
otp-bb3ab56962bae22e40b51dfce18ef37b465087a7.tar.bz2
otp-bb3ab56962bae22e40b51dfce18ef37b465087a7.zip
Merge branch 'maint'
* maint: compiler: Fix compiler crash introduced by OTP-15952
Diffstat (limited to 'lib/compiler/src')
-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 28b2e55c43..89053c7b9f 100644
--- a/lib/compiler/src/beam_ssa_pre_codegen.erl
+++ b/lib/compiler/src/beam_ssa_pre_codegen.erl
@@ -1623,10 +1623,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([?EXCEPTION_BLOCK | T], OtherPath) ->
+ %% ?EXCEPTION_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.