diff options
author | Björn Gustavsson <[email protected]> | 2018-08-23 09:47:08 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-08-23 09:47:08 +0200 |
commit | 5ed84b869a3f54a7132932226a72b6f5dd6f7457 (patch) | |
tree | 77c9e9294d06ec88260a2d2cdd54172ab39ac9f9 /lib/compiler/src/beam_validator.erl | |
parent | 669419137b631b895efce327e0aee9ace03c2ba0 (diff) | |
parent | 840b04bbd9359375a7491f5555bf84363cd08d22 (diff) | |
download | otp-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.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 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), |