Opened 6 years ago

Last modified 4 years ago

#12821 new Bugs

Crash in integer_sort when reverse sorting a struct — at Initial Version

Reported by: Domagoj Šarić Owned by: Paul A. Bristow
Milestone: To Be Determined Component: sort
Version: Boost 1.63.0 Severity: Showstopper
Keywords: 1 Cc: arachni@…

Description

Crash in integer_sort when reverse sorting a struct

I have a custom 'zip' iterator (that iterates over two arrays):

  • its value_type = std::pair<std::uint32_t, T>
  • its reference = std::pair<std::uint32_t &, T &>.

I want to reverse sort these two arrays so I do: auto const comparator( []( auto const & left, auto const & right ) noexcept { return left.first < right.first; } ); auto const rightshift{ []( custom_iterator::reference const x, unsigned const offset ) noexcept { return x.first >> offset; } };

...but there is a crash in integer_sort in this case (if I do a 'normal' less-than compare, i.e. not a reversed sort) then it works...

Change History (0)

Note: See TracTickets for help on using tickets.