aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_validator.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-08-23 09:47:08 +0200
committerBjörn Gustavsson <[email protected]>2018-08-23 09:47:08 +0200
commit5ed84b869a3f54a7132932226a72b6f5dd6f7457 (patch)
tree77c9e9294d06ec88260a2d2cdd54172ab39ac9f9 /lib/compiler/src/beam_validator.erl
parent669419137b631b895efce327e0aee9ace03c2ba0 (diff)
parent840b04bbd9359375a7491f5555bf84363cd08d22 (diff)
downloadotp-5ed84b869a3f54a7132932226a72b6f5dd6f7457.tar.gz
otp-5ed84b869a3f54a7132932226a72b6f5dd6f7457.tar.bz2
otp-5ed84b869a3f54a7132932226a72b6f5dd6f7457.zip
Merge branch 'bjorn/compiler/fix-is_map_key-issues/OTP-15227' into maint
* bjorn/compiler/fix-is_map_key-issues/OTP-15227: map_SUITE: Test is_map_key/2 followed by a map update beam_validator: Infer the type of the map argument for is_map_key/2 map_SUITE: Cover map_get optimizations in beam_dead
Diffstat (limited to 'lib/compiler/src/beam_validator.erl')
-rw-r--r--lib/compiler/src/beam_validator.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index a0eef826ce..fb2e7df65c 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -565,6 +565,12 @@ valfun_4({bif,map_get,{f,Fail},[_Key,Map]=Src,Dst}, Vst0) ->
Vst = set_type(map, Map, Vst1),
Type = propagate_fragility(term, Src, Vst),
set_type_reg(Type, Dst, Vst);
+valfun_4({bif,is_map_key,{f,Fail},[_Key,Map]=Src,Dst}, Vst0) ->
+ validate_src(Src, Vst0),
+ Vst1 = branch_state(Fail, Vst0),
+ Vst = set_type(map, Map, Vst1),
+ Type = propagate_fragility(bool, Src, Vst),
+ set_type_reg(Type, Dst, Vst);
valfun_4({bif,Op,{f,Fail},Src,Dst}, Vst0) ->
validate_src(Src, Vst0),
Vst = branch_state(Fail, Vst0),