forked from OSchip/llvm-project
Fix buffer overflow issue in valarray test
llvm-svn: 217012
This commit is contained in:
parent
925e51b11d
commit
99ff9c7bb2
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue