aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-01-24 14:43:09 +0100
committerJohn Högberg <[email protected]>2019-01-24 14:43:22 +0100
commitbd6a3d3c574644151ecc4d919673bb0526c94bd0 (patch)
tree0859df3c3171cfab6adf7f9733a549ea1ccbfca5 /lib/compiler/test
parenta0104bc16c8c6f57c2725d07b811bf3bcb0a2455 (diff)
downloadotp-bd6a3d3c574644151ecc4d919673bb0526c94bd0.tar.gz
otp-bd6a3d3c574644151ecc4d919673bb0526c94bd0.tar.bz2
otp-bd6a3d3c574644151ecc4d919673bb0526c94bd0.zip
Make the beam_validator smarter again, again
The fix in f9ea85611faca82c7494449ddb8bcb1ef1d194cb didn't consider that the tested register could be aliased.
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/beam_validator_SUITE.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl
index c9df066958..585d0e7191 100644
--- a/lib/compiler/test/beam_validator_SUITE.erl
+++ b/lib/compiler/test/beam_validator_SUITE.erl
@@ -586,6 +586,9 @@ aliased_types(Config) ->
{1,1} = aliased_types_2(Seq),
{42,none} = aliased_types_2([]),
+ gurka = aliased_types_3([gurka]),
+ gaffel = aliased_types_3([gaffel]),
+
ok.
%% ERL-735: validator failed to track types on aliased registers, rejecting
@@ -614,6 +617,20 @@ aliased_types_2(Bug) ->
_ -> hd(Bug)
end}.
+%% ERL-832 part deux; validator failed to realize that an aliased register was
+%% a cons.
+aliased_types_3(Bug) ->
+ List = [Y || Y <- Bug],
+ case List of
+ [] -> Bug;
+ _ ->
+ if
+ hd(List) -> a:a();
+ true -> ok
+ end,
+ hd(List)
+ end.
+
%%%-------------------------------------------------------------------------
transform_remove(Remove, Module) ->