aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2015-04-22 09:43:11 +0200
committerHans Bolinder <[email protected]>2015-04-22 09:43:11 +0200
commitb620955a8a45465de2d4c8765d7960addc4efd50 (patch)
treec8692a17500a7525396b100f54fa221f9de8ea60 /lib
parent4bbc18a0f382cd27e3a91d5e195a2a921fdd28f1 (diff)
parentc624ca99d9944782a69407bd9194ab8f4e98341c (diff)
downloadotp-b620955a8a45465de2d4c8765d7960addc4efd50.tar.gz
otp-b620955a8a45465de2d4c8765d7960addc4efd50.tar.bz2
otp-b620955a8a45465de2d4c8765d7960addc4efd50.zip
Merge branch 'hb/hipe/opaque_bugfix/OTP-12666'
* hb/hipe/opaque_bugfix/OTP-12666: hipe: Fix a bug in the handling of opaque types
Diffstat (limited to 'lib')
-rw-r--r--lib/hipe/cerl/erl_types.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index 09dffe1280..798212d5f9 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -2636,15 +2636,19 @@ inf_collect(_T1, [], _Opaques, OpL) ->
combine(S, T1, T2) ->
#opaque{mod = Mod1, name = Name1, args = Args1} = T1,
#opaque{mod = Mod2, name = Name2, args = Args2} = T2,
+ Comb1 = comb(Mod1, Name1, Args1, S, T1),
case is_same_type_name({Mod1, Name1, Args1}, {Mod2, Name2, Args2}) of
- true -> [comb(Mod1, Name1, Args1, S, T1)];
- false -> [comb(Mod1, Name1, Args1, S, T1), comb(Mod2, Name2, Args2, S, T2)]
+ true -> Comb1;
+ false -> Comb1 ++ comb(Mod2, Name2, Args2, S, T2)
end.
comb(Mod, Name, Args, S, T) ->
case is_same_name(Mod, Name, Args, S) of
- true -> S;
- false -> T#opaque{struct = S}
+ true ->
+ ?opaque(Set) = S,
+ Set;
+ false ->
+ [T#opaque{struct = S}]
end.
is_same_name(Mod1, Name1, Args1,