Fix buffer overflow issue in valarray test

llvm-svn: 217012
This commit is contained in:
Eric Fiselier 2014-09-03 05:47:35 +00:00
parent 925e51b11d
commit 99ff9c7bb2
1 changed files with 2 additions and 3 deletions

View File

@ -47,9 +47,8 @@ int main()
int a1[] = {0, 1, 2};
int a2[] = {3, 4, 3};
std::valarray<int> v1(a1, 3);
const std::valarray<int> v2(a2, 3);
std::slice_array<int> s1 = v1[std::slice(1, 2, 3)];
std::slice_array<int> s2 = v1[std::slice(2, 2, 3)];
std::slice_array<int> s1 = v1[std::slice(1, 1, 1)];
std::slice_array<int> s2 = v1[std::slice(0, 1, 1)];
std::slice_array<int> const & s3 = (s1 = s2);
assert(&s1 == &s3);
}