aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-07-04 14:44:53 +0200
committerJohn Högberg <[email protected]>2019-07-04 14:44:53 +0200
commit0582460b5ad757b53e332a84fb365542b0e76e8e (patch)
tree35e5b66ddd3e786709318e73edfc6ffc5fe7e284 /lib/compiler/src
parent1e939011dadacc699f249ca6392345351f5bcadc (diff)
parenta8461ffed773c4ff80779c16a3637ba3d2e915fd (diff)
downloadotp-0582460b5ad757b53e332a84fb365542b0e76e8e.tar.gz
otp-0582460b5ad757b53e332a84fb365542b0e76e8e.tar.bz2
otp-0582460b5ad757b53e332a84fb365542b0e76e8e.zip
Merge branch 'john/compiler/fix-fail-path-exceptions-bsm/OTP-15946' into maint
* john/compiler/fix-fail-path-exceptions-bsm/OTP-15946: beam_ssa_bsm: Leave ?BADARG_BLOCK alone when cloning fail path
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/beam_ssa_bsm.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_ssa_bsm.erl b/lib/compiler/src/beam_ssa_bsm.erl
index 382e6f635e..1ac9e6a3bb 100644
--- a/lib/compiler/src/beam_ssa_bsm.erl
+++ b/lib/compiler/src/beam_ssa_bsm.erl
@@ -683,8 +683,12 @@ aca_copy_successors(Lbl0, Blocks0, Counter0) ->
Lbl = maps:get(Lbl0, BRs),
{Lbl, Blocks, Counter}.
+aca_cs_build_brs([?BADARG_BLOCK=Lbl | Path], Counter, Acc) ->
+ %% ?BADARG_BLOCK is a marker and not an actual block, so renaming it will
+ %% break exception handling.
+ aca_cs_build_brs(Path, Counter, Acc#{ Lbl => Lbl });
aca_cs_build_brs([Lbl | Path], Counter0, Acc) ->
- aca_cs_build_brs(Path, Counter0 + 1, maps:put(Lbl, Counter0, Acc));
+ aca_cs_build_brs(Path, Counter0 + 1, Acc#{ Lbl => Counter0 });
aca_cs_build_brs([], Counter, Acc) ->
{Acc, Counter}.