diff options
author | Björn Gustavsson <[email protected]> | 2016-06-28 07:23:40 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-09-21 14:07:53 +0200 |
commit | 6a7f1675e84bef3f780f212bd3ce74898aebc7ab (patch) | |
tree | d227a6eb62696ed941de074b9293d1b79bc10cda /lib/compiler/src/beam_jump.erl | |
parent | 23ec13650736e617b1801585bdb87c0caffb70cf (diff) | |
download | otp-6a7f1675e84bef3f780f212bd3ce74898aebc7ab.tar.gz otp-6a7f1675e84bef3f780f212bd3ce74898aebc7ab.tar.bz2 otp-6a7f1675e84bef3f780f212bd3ce74898aebc7ab.zip |
beam_jump: Don't try to handle a label at the very end
Since the beam_a pass has always been run and have removed any
unused label, there can never be a label as the very last
instruction in a function.
Diffstat (limited to 'lib/compiler/src/beam_jump.erl')
-rw-r--r-- | lib/compiler/src/beam_jump.erl | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_jump.erl b/lib/compiler/src/beam_jump.erl index 9030ea5446..5311ce7379 100644 --- a/lib/compiler/src/beam_jump.erl +++ b/lib/compiler/src/beam_jump.erl @@ -155,9 +155,7 @@ share(Is0) -> Is = eliminate_fallthroughs(Is0, []), share_1(Is, #{}, [], []). -share_1([{label,_}=Lbl|Is], Dict, [], Acc) -> - share_1(Is, Dict, [], [Lbl|Acc]); -share_1([{label,L}=Lbl|Is], Dict0, Seq, Acc) -> +share_1([{label,L}=Lbl|Is], Dict0, [_|_]=Seq, Acc) -> case maps:find(Seq, Dict0) of error -> Dict = maps:put(Seq, L, Dict0), |