diff options
author | Björn Gustavsson <[email protected]> | 2017-08-31 10:08:48 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-08-31 10:08:48 +0200 |
commit | f0b2ac51019181cc765b55e95b2723f5ed03d3fa (patch) | |
tree | e9b5446e53613d3f9e97c3cd1eaa08ca18db4d93 /lib | |
parent | 81542a84139d63e855823a4f8f9af9a31852923b (diff) | |
parent | c8e6fc560fc8fd2f0e993975d33a017503f0489b (diff) | |
download | otp-f0b2ac51019181cc765b55e95b2723f5ed03d3fa.tar.gz otp-f0b2ac51019181cc765b55e95b2723f5ed03d3fa.tar.bz2 otp-f0b2ac51019181cc765b55e95b2723f5ed03d3fa.zip |
Merge branch 'maint'
* maint:
Make handling of match contexts stricter
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compiler/src/beam_validator.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl index 622e00bb2b..00901077d3 100644 --- a/lib/compiler/src/beam_validator.erl +++ b/lib/compiler/src/beam_validator.erl @@ -1430,13 +1430,13 @@ merge_types(bool, {atom,A}) -> merge_bool(A); merge_types({atom,A}, bool) -> merge_bool(A); -merge_types(#ms{id=Id,valid=B0,slots=Slots}=M, - #ms{id=Id,valid=B1,slots=Slots}) -> - M#ms{valid=B0 bor B1,slots=Slots}; -merge_types(#ms{}=M, _) -> - M; -merge_types(_, #ms{}=M) -> - M; +merge_types(#ms{id=Id1,valid=B0,slots=Slots}, + #ms{id=Id2,valid=B1,slots=Slots}) -> + Id = if + Id1 =:= Id2 -> Id1; + true -> make_ref() + end, + #ms{id=Id,valid=B0 band B1,slots=Slots}; merge_types(T1, T2) when T1 =/= T2 -> %% Too different. All we know is that the type is a 'term'. term. |