aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-05-11 06:59:15 +0200
committerBjörn Gustavsson <[email protected]>2016-05-13 10:52:25 +0200
commit8c76f74c376d8ced1742e59b8bee851502411124 (patch)
treec9a06a197d2f9100af3dfbf846f7c7db243e7d68 /lib/compiler/src
parent293962a8ee0af2e15dc8459c7a85e917b84b402a (diff)
downloadotp-8c76f74c376d8ced1742e59b8bee851502411124.tar.gz
otp-8c76f74c376d8ced1742e59b8bee851502411124.tar.bz2
otp-8c76f74c376d8ced1742e59b8bee851502411124.zip
beam_utils: Let code_at/2 fail if the label does not exist
All callers only calls code_at/2 for existing labels and they don't handle the return value 'none'.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/beam_utils.erl5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index a96f2bdc65..dd3c2ff913 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -137,10 +137,7 @@ index_label(Lbl, Is0, Acc) ->
%% Retrieve the code at the given label.
code_at(L, Ll) ->
- case gb_trees:lookup(L, Ll) of
- {value,Code} -> Code;
- none -> none
- end.
+ gb_trees:get(L, Ll).
%% bif_to_test(Bif, [Op], Fail) -> {test,Test,Fail,[Op]}
%% Convert a BIF to a test. Fail if not possible.