[Issue 20799] New: schwartzSort does not pin transformation results with indirections, leading to memory corruption

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 6 09:47:07 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20799

          Issue ID: 20799
           Summary: schwartzSort does not pin transformation results with
                    indirections, leading to memory corruption
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: dlang-bugzilla at thecybershadow.net
          Reporter: dlang-bugzilla at thecybershadow.net

import std.algorithm.sorting;
import std.range;

void main()
{
        auto arr = 1_000_000.iota.retro.array;
        arr.schwartzSort!(
                n => new int(n),
                (a, b) => *a < *b
        );
        assert(arr.isSorted());
}

--


More information about the Digitalmars-d-bugs mailing list