Commit a38814c0 by Ville Voutilainen Committed by Ville Voutilainen

re PR libstdc++/77717…

re PR libstdc++/77717 (testsuite/21_strings/basic_string_view/operations/compare/char/1.cc makes undefined memcmp call)

	PR libstdc++/77717
	* testsuite/21_strings/basic_string_view/operations/compare/char/1.cc:
	Fix an out-of-bounds access.

From-SVN: r240486
parent 81fea426
2016-09-26 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/77717
* testsuite/21_strings/basic_string_view/operations/compare/char/1.cc:
Fix an out-of-bounds access.
2016-09-26 Marek Polacek <polacek@redhat.com>
PR c/7652
......
......@@ -82,8 +82,8 @@ test01()
test_value(strncmp(str_1.data(), str_0.data(), 6), z);
test_value(strncmp(str_1.data(), str_0.data(), 14), lt);
test_value(memcmp(str_1.data(), str_0.data(), 6), z);
test_value(memcmp(str_1.data(), str_0.data(), 14), lt);
test_value(memcmp("costa marbella", "costa rica", 14), lt);
test_value(memcmp(str_1.data(), str_0.data(), 10), lt);
test_value(memcmp("costa marbella", "costa rica", 10), lt);
// int compare(const basic_string_view& str) const;
test_value(str_0.compare(str_1), gt); //because r>m
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment