Yes, I didn't trace all the members which call __unguarded_partition_pivot.
The better (in my opinion) fix is to change __introselect from:
__last - __first > 3
to:
__last - __first > int(_S_threshold)
Like the other call the __unguarded_partition_pivot.
I am currently testing that change.
The 'last - 2' was on purpose (although, it is causing the problem!), as 'last - 1' is the the last element of the array which we want to avoid (think of it as 'last - 1 - 1', to go with 'first + 1'. Obviously we couldn't de-ref 'last - 1'.
Yes, I didn't trace all the members which call __unguarded_ partition_ pivot.
The better (in my opinion) fix is to change __introselect from:
__last - __first > 3
to:
__last - __first > int(_S_threshold)
Like the other call the __unguarded_ partition_ pivot.
I am currently testing that change.
The 'last - 2' was on purpose (although, it is causing the problem!), as 'last - 1' is the the last element of the array which we want to avoid (think of it as 'last - 1 - 1', to go with 'first + 1'. Obviously we couldn't de-ref 'last - 1'.