diff options
author | Hans Bolinder <[email protected]> | 2015-04-21 14:23:55 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2015-04-21 14:26:51 +0200 |
commit | c624ca99d9944782a69407bd9194ab8f4e98341c (patch) | |
tree | 3f19817f8922d9fe451fd0191f806afc08411ec5 /lib/hipe/cerl | |
parent | 69e365b59cf63b0cf504efe77b92b6ab7ad5d38c (diff) | |
download | otp-c624ca99d9944782a69407bd9194ab8f4e98341c.tar.gz otp-c624ca99d9944782a69407bd9194ab8f4e98341c.tar.bz2 otp-c624ca99d9944782a69407bd9194ab8f4e98341c.zip |
hipe: Fix a bug in the handling of opaque types
An opaque type ?opaque(_) was put in a list where #opaque{} was
expected.
Diffstat (limited to 'lib/hipe/cerl')
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 12 |
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, |