Summary: sort() and topN() fail on sliced/resized array of
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Magnus Lie Hetland <> 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:
------- You are receiving this mail because: -------

Reply via email to