[libcxx] r217012 - Fix buffer overflow issue in valarray test

Eric Fiselier eric at efcs.ca
Tue Sep 2 22:47:35 PDT 2014


Author: ericwf
Date: Wed Sep  3 00:47:35 2014
New Revision: 217012

URL: http://llvm.org/viewvc/llvm-project?rev=217012&view=rev
Log:
Fix buffer overflow issue in valarray test

Modified:
    libcxx/trunk/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp

Modified: libcxx/trunk/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp?rev=217012&r1=217011&r2=217012&view=diff
==============================================================================
--- libcxx/trunk/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp (original)
+++ libcxx/trunk/test/numerics/numarray/template.slice.array/slice.arr.assign/slice_array.pass.cpp Wed Sep  3 00:47:35 2014
@@ -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);
     }





More information about the cfe-commits mailing list