libstdc++: Fix memory issue in ranges::lexicographical_compare testcase
authorPatrick Palka <ppalka@redhat.com>
Thu, 29 Oct 2020 14:11:12 +0000 (10:11 -0400)
committerPatrick Palka <ppalka@redhat.com>
Thu, 29 Oct 2020 14:11:12 +0000 (10:11 -0400)
libstdc++-v3/ChangeLog:

* testsuite/25_algorithms/lexicographical_compare/constrained.cc:
(test03): Fix initializing the vector vy with the array y of size 4.

libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc

index b82c872bbbbeedc20682d4b62960cc64817c085b..2019bbc75e40ffb9e4de915080892399e4043d20 100644 (file)
@@ -136,7 +136,7 @@ test03()
       VERIFY( !ranges::lexicographical_compare(cy.begin(), cy.end(),
                                               cz.begin(), cz.end()) );
 
-      std::vector<int> vx(x, x+5), vy(y, y+5);
+      std::vector<int> vx(x, x+5), vy(y, y+4);
       VERIFY( ranges::lexicographical_compare(vx, vy) );
       VERIFY( !ranges::lexicographical_compare(vx, vy, ranges::greater{}) );
       VERIFY( !ranges::lexicographical_compare(vy, vx) );