Thread overview
[Issue 6781] New: Compiler Segfault on Complicated Nested Function Testcase
Oct 07, 2011
David Simcha
[Issue 6781] Regression(2.055): Segfault with error in local alias template
Oct 18, 2011
Don
Oct 18, 2011
Walter Bright
October 07, 2011
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: nobody@puremagic.com
        ReportedBy: dsimcha@yahoo.com


--- Comment #0 from David Simcha <dsimcha@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: -------
October 18, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6781


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |ice-on-invalid-code
                 CC|                            |clugdbug@yahoo.com.au
            Summary|Compiler Segfault on        |Regression(2.055): Segfault
                   |Complicated Nested Function |with error in local alias
                   |Testcase                    |template


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2011-10-17 23:16:53 PDT ---
This is ice-on-invalid code. Reduced test case:

void bug6781(alias xxx)() {
    some_error;
}
struct C6781 {
    void makeSortedIndices() {
        int greater;
        bug6781!greater();
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 18, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6781


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-10-18 12:18:02 PDT ---
https://github.com/D-Programming-Language/dmd/commit/6e4f808ca5b4d5222f2e1d677fd6f90fb02fe117

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