aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-02-19 07:49:31 +0100
committerJohn Högberg <[email protected]>2019-02-20 18:40:24 +0100
commit9c2c978ede9083244a11315814ea2c0d5a33b736 (patch)
treee5cdc8e04794030ac8c25dc3fa14cd223915cdf0
parentd7a066357dfcf0588c7352189288e1af431869c2 (diff)
downloadotp-9c2c978ede9083244a11315814ea2c0d5a33b736.tar.gz
otp-9c2c978ede9083244a11315814ea2c0d5a33b736.tar.bz2
otp-9c2c978ede9083244a11315814ea2c0d5a33b736.zip
beam_validator: Treat all bs_get instructions as extractions
While this is strictly only relevant for bs_get_binary2, we should never build anything while matching a message, so it ought to be safe to remove this last raw use of propagate_fragility.
-rw-r--r--lib/compiler/src/beam_validator.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index 7b82f70b18..37e0084dd7 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -747,8 +747,7 @@ valfun_4({test,bs_get_integer2,{f,Fail},Live,[Ctx,_,_,_],Dst}, Vst) ->
valfun_4({test,bs_get_float2,{f,Fail},Live,[Ctx,_,_,_],Dst}, Vst) ->
validate_bs_get(Fail, Ctx, Live, {float, []}, Dst, Vst);
valfun_4({test,bs_get_binary2,{f,Fail},Live,[Ctx,_,_,_],Dst}, Vst) ->
- Type = propagate_fragility(term, [Ctx], Vst),
- validate_bs_get(Fail, Ctx, Live, Type, Dst, Vst);
+ validate_bs_get(Fail, Ctx, Live, binary, Dst, Vst);
valfun_4({test,bs_get_utf8,{f,Fail},Live,[Ctx,_],Dst}, Vst) ->
validate_bs_get(Fail, Ctx, Live, {integer, []}, Dst, Vst);
valfun_4({test,bs_get_utf16,{f,Fail},Live,[Ctx,_],Dst}, Vst) ->
@@ -998,7 +997,7 @@ validate_bs_get(Fail, Ctx, Live, Type, Dst, Vst0) ->
verify_y_init(Vst0),
Vst1 = prune_x_regs(Live, Vst0),
Vst = branch_state(Fail, Vst1),
- create_term(Type, Dst, Vst).
+ extract_term(Type, [Ctx], Dst, Vst).
%%
%% Common code for validating bs_skip_utf* instructions.