This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/58800] [4.7.4/4.8.2/4.9 Regression] std::nth_element segfaults on valid input
- From: "chris at bubblescope dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 19 Oct 2013 12:11:37 +0000
- Subject: [Bug libstdc++/58800] [4.7.4/4.8.2/4.9 Regression] std::nth_element segfaults on valid input
- Auto-submitted: auto-generated
- References: <bug-58800-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58800
Chris Jefferson <chris at bubblescope dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #31049|0 |1
is obsolete| |
--- Comment #19 from Chris Jefferson <chris at bubblescope dot net> ---
Created attachment 31051
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31051&action=edit
nth_element patch
Here is a patch. The actual patch is just changing '__last - 2' to '__last - 1'
(***NOTE*** When back-applying this patch, before the recent merge of
algorithms, there will be two copies of __last - 2 to change).
The larger part is a patch just for this bug, and a general big improvement in
the test procedure, to sanity check no other related methods have any issues
(they do not). I intend to continue to add new testsuite functions in the
future, but this will do to start.