aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_SUITE_data
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/small_SUITE_data
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/small_SUITE_data')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/limit.erl20
1 files changed, 20 insertions, 0 deletions
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.