diff options
author | Erlang/OTP <[email protected]> | 2018-10-12 17:12:03 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2018-10-12 17:12:03 +0200 |
commit | 2197249f2407e4912d461c627370b9838709d2f2 (patch) | |
tree | 175dde222ac700c476d090346a340db8d5ca3a6c /lib/compiler/src/beam_bsm.erl | |
parent | 2594eaa27076838bec33a2b2211ad5b17521b5cd (diff) | |
parent | 0bb261b730eff06cca524ea9999ff035585ef5b4 (diff) | |
download | otp-2197249f2407e4912d461c627370b9838709d2f2.tar.gz otp-2197249f2407e4912d461c627370b9838709d2f2.tar.bz2 otp-2197249f2407e4912d461c627370b9838709d2f2.zip |
Merge branch 'bjorn/compiler/fix-binary-matching/ERL-689/OTP-15335' into maint-21
* bjorn/compiler/fix-binary-matching/ERL-689/OTP-15335:
Fix rare bug in binary matching (again)
Diffstat (limited to 'lib/compiler/src/beam_bsm.erl')
-rw-r--r-- | lib/compiler/src/beam_bsm.erl | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/compiler/src/beam_bsm.erl b/lib/compiler/src/beam_bsm.erl index abc6e96c85..1c8e0e9854 100644 --- a/lib/compiler/src/beam_bsm.erl +++ b/lib/compiler/src/beam_bsm.erl @@ -310,18 +310,7 @@ btb_reaches_match_2([{test,bs_start_match2,{f,F},Live,[Bin,_],Ctx}|Is], end; btb_reaches_match_2([{test,_,{f,F},Ss}=I|Is], Regs, D0) -> btb_ensure_not_used(Ss, I, Regs), - D1 = btb_follow_branch(F, Regs, D0), - D = case Is of - [{bs_context_to_binary,_}|_] -> - %% bs_context_to_binary following a test instruction - %% probably needs the current position to be saved as - %% the new start position, but we can't be sure. - %% Therefore, conservatively disable the optimization - %% (instead of forcing a saving of the position). - D1#btb{must_save=true,must_not_save=true}; - _ -> - D1 - end, + D = btb_follow_branch(F, Regs, D0), btb_reaches_match_1(Is, Regs, D); btb_reaches_match_2([{test,_,{f,F},_,Ss,_}=I|Is], Regs, D0) -> btb_ensure_not_used(Ss, I, Regs), |