aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-08-23 09:47:45 +0200
committerBjörn Gustavsson <[email protected]>2018-08-23 09:47:45 +0200
commit431da58a80bb972d1405ffd16da0bb0c9aab4d74 (patch)
tree74c9857fcd4723fa700065737776ef0ded3b47ad /lib/compiler/src
parent9a95f6f1cda59e337b11f5213c932f7fbdc17a61 (diff)
parent5ed84b869a3f54a7132932226a72b6f5dd6f7457 (diff)
downloadotp-431da58a80bb972d1405ffd16da0bb0c9aab4d74.tar.gz
otp-431da58a80bb972d1405ffd16da0bb0c9aab4d74.tar.bz2
otp-431da58a80bb972d1405ffd16da0bb0c9aab4d74.zip
Merge branch 'maint'
* maint: 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')
-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 c09dbadd7f..8b3c33dfb5 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),