diff options
author | Björn Gustavsson <[email protected]> | 2018-01-31 10:06:41 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-01-31 10:06:41 +0100 |
commit | 2e5063371ca21eeabd9c20462c16fac0ee147028 (patch) | |
tree | 7d03302dfd73d920e5bc99634602f8f73f583a6e /lib/compiler/src/beam_type.erl | |
parent | 184db040e4fca5eacd7150098d77c4d5829d6c52 (diff) | |
parent | c455dc2ca108e8ffbf5431068223fcff8aeb5361 (diff) | |
download | otp-2e5063371ca21eeabd9c20462c16fac0ee147028.tar.gz otp-2e5063371ca21eeabd9c20462c16fac0ee147028.tar.bz2 otp-2e5063371ca21eeabd9c20462c16fac0ee147028.zip |
Merge branch 'bjorn/compiler/fix-beam_type-bug/OTP-14898' into maint
* bjorn/compiler/fix-beam_type-bug/OTP-14898:
Fix incorrect type interference of integer ranges
Diffstat (limited to 'lib/compiler/src/beam_type.erl')
-rw-r--r-- | lib/compiler/src/beam_type.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl index c8abfa524f..fc2c7a991b 100644 --- a/lib/compiler/src/beam_type.erl +++ b/lib/compiler/src/beam_type.erl @@ -914,10 +914,10 @@ merge_type_info({tuple,Sz1,[]}, {tuple,_Sz2,First}=Tuple2) -> merge_type_info({tuple,Sz1,First}, Tuple2); merge_type_info({tuple,_Sz1,First}=Tuple1, {tuple,Sz2,_}) -> merge_type_info(Tuple1, {tuple,Sz2,First}); -merge_type_info(integer, {integer,_}=Int) -> - Int; -merge_type_info({integer,_}=Int, integer) -> - Int; +merge_type_info(integer, {integer,_}) -> + integer; +merge_type_info({integer,_}, integer) -> + integer; merge_type_info({integer,{Min1,Max1}}, {integer,{Min2,Max2}}) -> {integer,{max(Min1, Min2),min(Max1, Max2)}}; merge_type_info(NewType, _) -> |