aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_ssa_opt.erl
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-01-21 10:40:27 +0100
committerJohn Högberg <[email protected]>2019-01-21 14:21:23 +0100
commitb7db13e2f3ef6990367fb2cc08263da8a57e7414 (patch)
tree853d866f41057cbadc167033cb04ddf7610ecb4e /lib/compiler/src/beam_ssa_opt.erl
parent53b46c186051e256a4238f4c4b75e3dcbf61a1b0 (diff)
downloadotp-b7db13e2f3ef6990367fb2cc08263da8a57e7414.tar.gz
otp-b7db13e2f3ef6990367fb2cc08263da8a57e7414.tar.bz2
otp-b7db13e2f3ef6990367fb2cc08263da8a57e7414.zip
beam_ssa_opt: Don't ruin arguments of bs_match/skip
If the match instruction was already marked as a skip, we'd ruin its argument list.
Diffstat (limited to 'lib/compiler/src/beam_ssa_opt.erl')
-rw-r--r--lib/compiler/src/beam_ssa_opt.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_ssa_opt.erl b/lib/compiler/src/beam_ssa_opt.erl
index 6f7044f006..c587f9fb44 100644
--- a/lib/compiler/src/beam_ssa_opt.erl
+++ b/lib/compiler/src/beam_ssa_opt.erl
@@ -924,9 +924,10 @@ bsm_skip([], _) -> [].
bsm_skip_is([I0|Is], Extracted) ->
case I0 of
- #b_set{op=bs_match,args=[#b_literal{val=string}|_]} ->
- [I0|bsm_skip_is(Is, Extracted)];
- #b_set{op=bs_match,dst=Ctx,args=[Type,PrevCtx|Args0]} ->
+ #b_set{op=bs_match,
+ dst=Ctx,
+ args=[#b_literal{val=T}=Type,PrevCtx|Args0]}
+ when T =/= string, T =/= skip ->
I = case cerl_sets:is_element(Ctx, Extracted) of
true ->
I0;