diff options
author | Björn Gustavsson <[email protected]> | 2011-08-05 10:46:40 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-08-05 10:46:40 +0200 |
commit | 302b2a1bf0194ca81c7731699b75e4800f718955 (patch) | |
tree | 46b45bcefe605bdee0ee3788f9be688fc210214c /erts/emulator/test | |
parent | e995a244d830b688c2cb49ec0fda3653e41bb1c8 (diff) | |
parent | 44a70b59a1903265a33ccefa3846e10b3f86eb5d (diff) | |
download | otp-302b2a1bf0194ca81c7731699b75e4800f718955.tar.gz otp-302b2a1bf0194ca81c7731699b75e4800f718955.tar.bz2 otp-302b2a1bf0194ca81c7731699b75e4800f718955.zip |
Merge branch 'dev' into major
* dev:
Fix binary construction with huge literal sizes
beam_load.c: Add overflow check of tag values
beam_makeops: Add some sanity checks
Fix construction of <<0:((1 bsl 32)-1)>>
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/bs_construct_SUITE.erl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl index 1959803385..7fdf36711b 100644 --- a/erts/emulator/test/bs_construct_SUITE.erl +++ b/erts/emulator/test/bs_construct_SUITE.erl @@ -553,6 +553,11 @@ huge_float_check({'EXIT',{badarg,_}}) -> ok. huge_binary(Config) when is_list(Config) -> ?line 16777216 = size(<<0:(id(1 bsl 26)),(-1):(id(1 bsl 26))>>), + ?line garbage_collect(), + ?line id(<<0:((1 bsl 32)-1)>>), + ?line garbage_collect(), + ?line id(<<0:(id((1 bsl 32)-1))>>), + ?line garbage_collect(), ok. system_limit(Config) when is_list(Config) -> @@ -565,6 +570,10 @@ system_limit(Config) when is_list(Config) -> ?line {'EXIT',{system_limit,_}} = (catch <<(id(<<>>))/binary,0:(id(1 bsl 100))>>), + %% Would fail to load. + ?line {'EXIT',{system_limit,_}} = (catch <<0:(1 bsl 67)>>), + ?line {'EXIT',{system_limit,_}} = (catch <<0:((1 bsl 64)+1)>>), + case WordSize of 4 -> system_limit_32(); @@ -581,6 +590,14 @@ system_limit_32() -> ?line {'EXIT',{system_limit,_}} = (catch <<0:(id(8)),42:536870912/unit:8>>), ?line {'EXIT',{system_limit,_}} = (catch <<0:(id(8)),42:(id(536870912))/unit:8>>), + + %% The size would be silently truncated, resulting in a crash. + ?line {'EXIT',{system_limit,_}} = (catch <<0:(1 bsl 35)>>), + ?line {'EXIT',{system_limit,_}} = (catch <<0:((1 bsl 32)+1)>>), + + %% Would fail to load. + ?line {'EXIT',{system_limit,_}} = (catch <<0:(1 bsl 43)>>), + ?line {'EXIT',{system_limit,_}} = (catch <<0:((1 bsl 40)+1)>>), ok. badarg(Config) when is_list(Config) -> |