aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-11-27 19:42:46 +0100
committerSverker Eriksson <[email protected]>2013-11-27 19:42:46 +0100
commit06188473247fd1edc873d82cf07886fa7e53e8cb (patch)
tree9da8184924da8ba79c6c157acf0d878ab89a1cb4 /erts/emulator/test
parent6603481b4612cdc83529cdecc86d5206b99674fd (diff)
parentf32368c4b34c86aa772a372cdb3c306a79127185 (diff)
downloadotp-06188473247fd1edc873d82cf07886fa7e53e8cb.tar.gz
otp-06188473247fd1edc873d82cf07886fa7e53e8cb.tar.bz2
otp-06188473247fd1edc873d82cf07886fa7e53e8cb.zip
Merge branch 'sverk/bin2term-bitstr-bugs/OTP-11479' into maint
* sverk/bin2term-bitstr-bugs/OTP-11479: erts: Fix bug in binary_to_term for binaries larger than 2^31 erts: Fix bugs in binary_to_term for invalid bitstrings
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/binary_SUITE.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl
index 08ab094019..a340a805b5 100644
--- a/erts/emulator/test/binary_SUITE.erl
+++ b/erts/emulator/test/binary_SUITE.erl
@@ -631,7 +631,13 @@ safe_binary_to_term2(Config) when is_list(Config) ->
bad_terms(suite) -> [];
bad_terms(Config) when is_list(Config) ->
- ?line test_terms(fun corrupter/1).
+ ?line test_terms(fun corrupter/1),
+ {'EXIT',{badarg,_}} = (catch binary_to_term(<<131,$M,3:32,0,11,22,33>>)),
+ {'EXIT',{badarg,_}} = (catch binary_to_term(<<131,$M,3:32,9,11,22,33>>)),
+ {'EXIT',{badarg,_}} = (catch binary_to_term(<<131,$M,0:32,1,11,22,33>>)),
+ {'EXIT',{badarg,_}} = (catch binary_to_term(<<131,$M,-1:32,1,11,22,33>>)),
+ ok.
+
corrupter(Term) when is_function(Term);
is_function(hd(Term));
@@ -1221,14 +1227,9 @@ gc() ->
gc1() -> ok.
bit_sized_binary_sizes(Config) when is_list(Config) ->
- ?line [bsbs_1(A) || A <- lists:seq(0, 7)],
+ ?line [bsbs_1(A) || A <- lists:seq(1, 8)],
ok.
-bsbs_1(0) ->
- BinSize = 32+8,
- io:format("A: ~p BinSize: ~p", [0,BinSize]),
- Bin = binary_to_term(<<131,$M,5:32,0,0,0,0,0,0>>),
- BinSize = bit_size(Bin);
bsbs_1(A) ->
BinSize = 32+A,
io:format("A: ~p BinSize: ~p", [A,BinSize]),