aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-09-14 10:16:43 +0200
committerBjörn Gustavsson <[email protected]>2016-09-14 10:16:43 +0200
commitbe7d979dc3634cd38df48d23016d80cd4172606e (patch)
treeb85987205dc906acf5cbd4f96ff5ffcc9501c937 /lib/compiler/src
parent596b238d2ab630d680484bd61eace06712e5908f (diff)
parent81c5e15544679baeeb8c18b72156b79aa4badebb (diff)
downloadotp-be7d979dc3634cd38df48d23016d80cd4172606e.tar.gz
otp-be7d979dc3634cd38df48d23016d80cd4172606e.tar.bz2
otp-be7d979dc3634cd38df48d23016d80cd4172606e.zip
Merge branch 'bjorn/compiler/beam_validator/OTP-13863' into maint
* bjorn/compiler/beam_validator/OTP-13863: beam_validator: Handle unreachable instructions
Diffstat (limited to 'lib/compiler/src')
-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 4c0cb6780a..16dba35adc 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);