This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r272558 - in /branches/gcc-9-branch/libstdc++-v...
- From: redi at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Fri, 21 Jun 2019 17:37:07 -0000
- Subject: r272558 - in /branches/gcc-9-branch/libstdc++-v...
Author: redi
Date: Fri Jun 21 17:37:07 2019
New Revision: 272558
URL: https://gcc.gnu.org/viewcvs?rev=272558&root=gcc&view=rev
Log:
PR libstdc++/90920 restore previous checks for empty ranges
The change in r263433 broke the contract of the __rotate functions, by no
longer accepting empty ranges. That means that callers which inlined the
old version of std::rotate (without checks) that end up linking to a new
definition of std::__rotate (also without checks) could perform a divide
by zero and crash.
This restores the old contract of the __rotate overloads.
Backport from mainline
2019-06-19 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/90920 partially revert r263433
* include/bits/stl_algo.h (__rotate): Restore checks for empty ranges.
(rotate): Remove checks.
* testsuite/25_algorithms/rotate/90920.cc: New test.
Added:
branches/gcc-9-branch/libstdc++-v3/testsuite/25_algorithms/rotate/90920.cc
Modified:
branches/gcc-9-branch/libstdc++-v3/ChangeLog
branches/gcc-9-branch/libstdc++-v3/include/bits/stl_algo.h