aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-06-27 16:08:46 +0200
committerHans Bolinder <[email protected]>2014-08-21 09:22:08 +0200
commit6eac68854c414285b7a99f27196bbbfa7969b295 (patch)
tree11300443a664f962db49adbc1123dd9d69a50e49 /lib/dialyzer/test
parentdaed987f7ebae3fc8f969b4f55f225837267411b (diff)
downloadotp-6eac68854c414285b7a99f27196bbbfa7969b295.tar.gz
otp-6eac68854c414285b7a99f27196bbbfa7969b295.tar.bz2
otp-6eac68854c414285b7a99f27196bbbfa7969b295.zip
dialyzer, hipe: Fix a bug concerning is_record/2,3
Also fixed some cases where Dialyzer could crash due to reaching system limits.
Diffstat (limited to 'lib/dialyzer/test')
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/src/opaque/opaque_bug5.erl10
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/limit.erl20
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/opaque/opaque_bug5.erl b/lib/dialyzer/test/opaque_SUITE_data/src/opaque/opaque_bug5.erl
new file mode 100644
index 0000000000..28d739de8e
--- /dev/null
+++ b/lib/dialyzer/test/opaque_SUITE_data/src/opaque/opaque_bug5.erl
@@ -0,0 +1,10 @@
+%% Second arg of is_record call wasn't checked properly
+
+-module(opaque_bug5).
+
+-export([b/0]).
+
+b() ->
+ is_record(id({a}), id(a)).
+
+id(I) -> I.
diff --git a/lib/dialyzer/test/small_SUITE_data/src/limit.erl b/lib/dialyzer/test/small_SUITE_data/src/limit.erl
new file mode 100644
index 0000000000..97ee585b77
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/limit.erl
@@ -0,0 +1,20 @@
+%% Misc cases where Dialyzer would fail with system_limit or crash
+
+-module(limit).
+
+-export([tu/0, big/1, b2/0]).
+
+tu() ->
+ erlang:make_tuple(1 bsl 24, def, [{5,e},{1,a},{3,c}]).
+
+big(<<Int:1152921504606846976/unit:128,0,_/binary>>) -> {5,Int}.
+
+b2() ->
+ Maxbig = maxbig(),
+ _ = bnot Maxbig,
+ ok.
+
+maxbig() ->
+ %% We assume that the maximum arity is (1 bsl 19) - 1.
+ Ws = erlang:system_info(wordsize),
+ (((1 bsl ((16777184 * (Ws div 4))-1)) - 1) bsl 1) + 1.