This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/58800] [4.7.4/4.8.2/4.9 Regression] std::nth_element segfaults on valid input


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]