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

           Summary: Compiler Segfault on Complicated Nested Function
                    Testcase
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha <dsim...@yahoo.com> 2011-10-07 11:20:26 PDT ---
test.d:

ubyte delegate() outer() {
    ubyte inner() {
        return typeof(return).init;
    }

    return &inner;
}

class C {
    uint[] sortedIndices;

    void makeSortedIndices() {
        auto comparator = outer();
        bool greater(uint index1, uint index2) {
            return comparator() == 1;
        }
        sort!greater(sortedIndices);
    }
}

void sort(alias comp, T)(T data) {
    T less;
    size_t lessI = size_t.max, greaterI = data.length - 1;
    less[ti] = data[0..min(lessI, greaterI + 1)];
}

$ dmd -c test.d -v 
binary    dmd
version   v2.055
config    /home/dsimcha/dmd2/linux/bin64/dmd.conf
parse     test
importall test
import    object       
(/home/dsimcha/dmd2/linux/bin64/../../src/druntime/import/object.di)
semantic  test
semantic2 test
semantic3 test
Segmentation fault

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

Reply via email to