diff options
author | John Högberg <[email protected]> | 2019-07-01 11:42:11 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-07-01 11:42:11 +0200 |
commit | ab5090ce25c8ab4212c0ca23623cd46e09d12a2e (patch) | |
tree | 43431cd32305141393a76fccc803b225f4050102 /lib | |
parent | c4146a9e9d9e49e9a913acb9ce37f5816921626a (diff) | |
parent | c14e0eea80911e36fe45839af96bb9593c63bbb6 (diff) | |
download | otp-ab5090ce25c8ab4212c0ca23623cd46e09d12a2e.tar.gz otp-ab5090ce25c8ab4212c0ca23623cd46e09d12a2e.tar.bz2 otp-ab5090ce25c8ab4212c0ca23623cd46e09d12a2e.zip |
Merge branch 'john/erts/lists_subtract_fixes/OTP-15938/OTP-15939' into maint
* john/erts/lists_subtract_fixes/OTP-15938/OTP-15939:
erts: Fix integer overflow in loader
erts: Fix integer overflow in list subtraction
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/test/lists_SUITE.erl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl index 5dab6f6697..c3c54710eb 100644 --- a/lib/stdlib/test/lists_SUITE.erl +++ b/lib/stdlib/test/lists_SUITE.erl @@ -2600,6 +2600,15 @@ subtract(Config) when is_list(Config) -> [1,2,3,4,5,6,7,8,9,9999,10000,20,21,22] = sub(lists:seq(1, 10000)++[20,21,22], lists:seq(10, 9998)), + %% ERL-986; an integer overflow relating to term comparison + %% caused subtraction to be inconsistent. + Ids = [2985095936,47540628,135460048,1266126295,240535295, + 115724671,161800351,4187206564,4178142725,234897063, + 14773162,6662515191,133150693,378034895,1874402262, + 3507611978,22850922,415521280,253360400,71683243], + + [] = id(Ids) -- id(Ids), + %% Floats/integers. [42.0,42.0] = sub([42.0,42,42.0], [42,42,42]), [1,2,3,4,43.0] = sub([1,2,3,4,5,42.0,43.0], [42.0,5]), @@ -2627,6 +2636,8 @@ subtract(Config) when is_list(Config) -> ok. +id(I) -> I. + sub_non_matching(A, B) -> A = sub(A, B). |