aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_validator.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-09-14 10:24:27 +0200
committerBjörn Gustavsson <[email protected]>2016-09-14 10:24:27 +0200
commit3f8eeea4a291060a25bcc7d6a9f5d09e18cc9aa4 (patch)
tree77fd2e5d662de7437d9421fa5a61bdb994f06469 /lib/compiler/src/beam_validator.erl
parent19d6c4e7830ee8513a4b614cbb39862868fc57a1 (diff)
parent176b7c94e4146a65ccd2bd729d58487098dddd9c (diff)
downloadotp-3f8eeea4a291060a25bcc7d6a9f5d09e18cc9aa4.tar.gz
otp-3f8eeea4a291060a25bcc7d6a9f5d09e18cc9aa4.tar.bz2
otp-3f8eeea4a291060a25bcc7d6a9f5d09e18cc9aa4.zip
Merge branch 'maint'
* maint: beam_validator: Handle unreachable instructions Turn off parallel make for start scripts Makefile
Diffstat (limited to 'lib/compiler/src/beam_validator.erl')
-rw-r--r--lib/compiler/src/beam_validator.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index 61aea57906..ffd136c6db 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -808,9 +808,11 @@ validate_bs_skip_utf(Fail, Ctx, Live, Vst0) ->
%% A possibility for garbage collection must not occur between setelement/3 and
%% set_tuple_element/3.
%%
+%% Note that #vst.current will be 'none' if the instruction is unreachable.
+%%
val_dsetel({move,_,_}, Vst) ->
Vst;
-val_dsetel({call_ext,3,{extfunc,erlang,setelement,3}}, #vst{current=St}=Vst) ->
+val_dsetel({call_ext,3,{extfunc,erlang,setelement,3}}, #vst{current=#st{}=St}=Vst) ->
Vst#vst{current=St#st{setelem=true}};
val_dsetel({set_tuple_element,_,_,_}, #vst{current=#st{setelem=false}}) ->
error(illegal_context_for_set_tuple_element);