http://d.puremagic.com/issues/show_bug.cgi?id=5773

           Summary: sort() and topN() fail on sliced/resized array of
                    tuples
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: mag...@hetland.org


--- Comment #0 from Magnus Lie Hetland <mag...@hetland.org> 2011-03-23 12:52:03 
PDT ---
Sample program:

import std.algorithm, std.typecons;
void main() {
    alias Tuple!(real,uint) entry;
    auto entries = new entry[100];
    foreach (i, ref e; entries) {
        e[0] = 3.14*i;
        e[1] = i;
    }
    entries = entries[1 .. $];
    // sort(entries);
    // topN(entries, 50);
}

When uncommented (on their own), the sort statement gives a segmentation fault,
and the topN statement gives the error "object.Exception@src/rt/arraycat.d(40):
overlapping array copy".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to