Index: /nfs/devco/vitek/stdcxx-trunk/tests/algorithms/25.remove.cpp =================================================================== --- /nfs/devco/vitek/stdcxx-trunk/tests/algorithms/25.remove.cpp (revision 584926) +++ /nfs/devco/vitek/stdcxx-trunk/tests/algorithms/25.remove.cpp (working copy) @@ -210,12 +210,15 @@ break; } - rw_assert (success, 0, line, - "line %d: %s<%s>(\"%s\", ..., %#c) ==> \"%{X=#*.*}\"; " - "unstable at offset %zu element ids: %d and %d", - __LINE__, fname, itname, src, val, - int (nsrc), int (i - 1), xsrc, - i - 1, xsrc [i - 1].id_, xsrc [i].id_); + // avoid reading past end of xsrc array on success + if (!success) { + rw_assert (success, 0, line, + "line %d: %s<%s>(\"%s\", ..., %#c) ==> \"%{X=#*.*}\"; " + "unstable at offset %zu element ids: %d and %d", + __LINE__, fname, itname, src, val, + int (nsrc), int (i - 1), xsrc, + i - 1, xsrc [i - 1].id_, xsrc [i].id_); + } // verify that the values of elements in the range [end, last) // are unchanged @@ -320,12 +323,15 @@ break; } - rw_assert (success, 0, line, - "line %d: %s<%s>(\"%s\", ..., %#c) ==> " - "\"%{X=#*.*}\"; unstable at offset %zu: element ids: %d and %d", - __LINE__, fname, itname, src, val, - int (nsrc - nrem), int (i - 1), xdst, - i - 1, xdst [i - 1].id_, xdst [i].id_); + // avoid reading past end of xdst array on success + if (!success) { + rw_assert (success, 0, line, + "line %d: %s<%s>(\"%s\", ..., %#c) ==> " + "\"%{X=#*.*}\"; unstable at offset %zu: element ids: %d and %d", + __LINE__, fname, itname, src, val, + int (nsrc - nrem), int (i - 1), xdst, + i - 1, xdst [i - 1].id_, xdst [i].id_); + } // verify the number of applications of the predicate p 25.2.7.9 if (tag.use_predicate) {