diff options
author | Björn Gustavsson <[email protected]> | 2018-08-23 09:47:45 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-08-23 09:47:45 +0200 |
commit | 431da58a80bb972d1405ffd16da0bb0c9aab4d74 (patch) | |
tree | 74c9857fcd4723fa700065737776ef0ded3b47ad /lib/compiler/src | |
parent | 9a95f6f1cda59e337b11f5213c932f7fbdc17a61 (diff) | |
parent | 5ed84b869a3f54a7132932226a72b6f5dd6f7457 (diff) | |
download | otp-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.erl | 6 |
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), |