diff options
author | Kjell Winblad <[email protected]> | 2019-02-14 15:37:43 +0100 |
---|---|---|
committer | Kjell Winblad <[email protected]> | 2019-02-14 15:37:43 +0100 |
commit | 11d4a893e50b1738b01846a5e669addb3e5a4f75 (patch) | |
tree | 96ce943ff5d991ef94be255e11aeb2ab78e9eb5b /lib/stdlib | |
parent | 5da74b88496c9231d2fbd9cb2b7aea1121b79fa0 (diff) | |
parent | acf97f8bcb4846bdc5935770b22ce1cb84a90a15 (diff) | |
download | otp-11d4a893e50b1738b01846a5e669addb3e5a4f75.tar.gz otp-11d4a893e50b1738b01846a5e669addb3e5a4f75.tar.bz2 otp-11d4a893e50b1738b01846a5e669addb3e5a4f75.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/test/binary_module_SUITE.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl index c5cfea5e9e..e0811f19cf 100644 --- a/lib/stdlib/test/binary_module_SUITE.erl +++ b/lib/stdlib/test/binary_module_SUITE.erl @@ -22,7 +22,8 @@ -export([all/0, suite/0, interesting/1,scope_return/1,random_ref_comp/1,random_ref_sr_comp/1, random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1, - copy/1, referenced/1,guard/1,encode_decode/1,badargs/1,longest_common_trap/1]). + copy/1, referenced/1,guard/1,encode_decode/1,badargs/1,longest_common_trap/1, + check_no_invalid_read_bug/1]). -export([random_number/1, make_unaligned/1]). @@ -36,7 +37,7 @@ all() -> [scope_return,interesting, random_ref_fla_comp, random_ref_sr_comp, random_ref_comp, parts, bin_to_list, list_to_bin, copy, referenced, guard, encode_decode, badargs, - longest_common_trap]. + longest_common_trap, check_no_invalid_read_bug]. -define(MASK_ERROR(EXPR),mask_error((catch (EXPR)))). @@ -1361,3 +1362,13 @@ make_unaligned2(Bin0) when is_binary(Bin0) -> Bin. id(I) -> I. + +check_no_invalid_read_bug(Config) when is_list(Config) -> + check_no_invalid_read_bug(24); +check_no_invalid_read_bug(60) -> + ok; +check_no_invalid_read_bug(I) -> + N = 1 bsl I, + binary:encode_unsigned(N+N), + binary:encode_unsigned(N+N, little), + check_no_invalid_read_bug(I+1). |