r272558 - in /branches/gcc-9-branch/libstdc++-v...

redi@gcc.gnu.org redi@gcc.gnu.org
Fri Jun 21 17:37:00 GMT 2019


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



More information about the Libstdc++-cvs mailing list