From 99ff9c7bb229d81ab3fa57360f398ffdfd3cdcd9 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 3 Sep 2014 05:47:35 +0000 Subject: [PATCH] Fix buffer overflow issue in valarray test llvm-svn: 217012 --- .../slice.arr.assign/slice_array.pass.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libcxx/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp b/libcxx/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp index 79be4bdb03df..72275e01e1be 100644 --- a/libcxx/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp +++ b/libcxx/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp @@ -47,9 +47,8 @@ int main() int a1[] = {0, 1, 2}; int a2[] = {3, 4, 3}; std::valarray v1(a1, 3); - const std::valarray v2(a2, 3); - std::slice_array s1 = v1[std::slice(1, 2, 3)]; - std::slice_array s2 = v1[std::slice(2, 2, 3)]; + std::slice_array s1 = v1[std::slice(1, 1, 1)]; + std::slice_array s2 = v1[std::slice(0, 1, 1)]; std::slice_array const & s3 = (s1 = s2); assert(&s1 == &s3); }