www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9453] New: ice(symbol.c) with slice on temporary

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9453

           Summary: ice(symbol.c) with slice on temporary
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: matthias.dondorff gmx.de



import std.string;

struct Foo {
    this(string bar) {     }

    Foo opSlice(size_t start, size_t end) const {
        return Foo();
    }

    size_t opDollar(int dim)() const if(dim == 0) { return 1; }
}

int main(string[] ) {
    auto b = Foo("bar")[0..$];
    return 0;
}

DMD 2.061 produces 

Internal error: ..\ztc\symbol.c 1025



-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9453


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull, rejects-valid
           Platform|x86                         |All
         OS/Version|Windows                     |All



Indexing has same problem.

struct Foo {
    this(string bar) {}

    Foo opIndex(size_t index) const {
        return Foo();
    }

    size_t opDollar(int dim)() const if(dim == 0) { return 1; }
}
int main(string[] ) {
    auto b = Foo("bar")[$-1];
    return 0;
}


Pull request:
https://github.com/D-Programming-Language/dmd/pull/1627

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9453




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/6e2f1ec1abfacf61f9f156ccf5b814a3f6e26591
fix Issue 9453 - ice(symbol.c) with slice on temporary

https://github.com/D-Programming-Language/dmd/commit/d9b239775639c414d1ba94cacb352dc724650c3c


Issue 9453 - ice(symbol.c) with slice on temporary

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 05 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9453


Walter Bright <bugzilla digitalmars.com> changed:

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


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