You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug was introduced by #45330 which tries to reduce the size of an allocated workspace to only what is needed. If sorting a v::AbstractVector on indices lo:hi, it allocates similar(v, hi) which has indices 1:hi, which may be insufficient if lo < 1. The right answer is to allocate similar(v, lo:hi), but that depends on loading OffsetArrays which does not happen in Base. Instead, we can use the simpler similar(v) to get a workspace that contains all of lo:hi (provided they are in bounds in the original vector).
This bug was introduced by #45330 which tries to reduce the size of an allocated workspace to only what is needed. If sorting a
v::AbstractVector
on indiceslo:hi
, it allocatessimilar(v, hi)
which has indices1:hi
, which may be insufficient iflo < 1
. The right answer is to allocatesimilar(v, lo:hi)
, but that depends on loading OffsetArrays which does not happen in Base. Instead, we can use the simplersimilar(v)
to get a workspace that contains all oflo:hi
(provided they are in bounds in the original vector).The text was updated successfully, but these errors were encountered: