aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-02-10 12:13:58 +0100
committerBjörn Gustavsson <[email protected]>2016-02-10 12:13:58 +0100
commit47c2ace2a036bbc5da7950aa8c59bc78b4e498e1 (patch)
treedb6f8324788e65cfc19a1a11460813a2ac6a088d /lib/compiler/src
parent8fba155bdc0b45f0504756d1ea695d9c53a44f80 (diff)
parentabde1d03db03536af19fdb274f1119bbfaba262b (diff)
downloadotp-47c2ace2a036bbc5da7950aa8c59bc78b4e498e1.tar.gz
otp-47c2ace2a036bbc5da7950aa8c59bc78b4e498e1.tar.bz2
otp-47c2ace2a036bbc5da7950aa8c59bc78b4e498e1.zip
Merge branch 'bjorn/compiler/beam_bsm/OTP-13309' into maint
* bjorn/compiler/beam_bsm/OTP-13309: Eliminate crash because of unsafe delaying of sub-binary creation
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/beam_bsm.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/compiler/src/beam_bsm.erl b/lib/compiler/src/beam_bsm.erl
index 4f76350269..62356928ae 100644
--- a/lib/compiler/src/beam_bsm.erl
+++ b/lib/compiler/src/beam_bsm.erl
@@ -421,7 +421,8 @@ btb_follow_branches([], _, D) -> D.
btb_follow_branch(0, _Regs, D) -> D;
btb_follow_branch(Lbl, Regs, #btb{ok_br=Br0,index=Li}=D) ->
- case gb_sets:is_member(Lbl, Br0) of
+ Key = {Lbl,Regs},
+ case gb_sets:is_member(Key, Br0) of
true ->
%% We have already followed this branch and it was OK.
D;
@@ -432,7 +433,7 @@ btb_follow_branch(Lbl, Regs, #btb{ok_br=Br0,index=Li}=D) ->
btb_reaches_match_1(Is, Regs, D),
%% Since we got back, this branch is OK.
- D#btb{ok_br=gb_sets:insert(Lbl, Br),must_not_save=MustNotSave,
+ D#btb{ok_br=gb_sets:insert(Key, Br),must_not_save=MustNotSave,
must_save=MustSave}
end.