www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1269] New: Compiler crash on constant string concat

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

           Summary: Compiler crash on constant string concat
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jascha mainia.de


import std.string;

const uint      VERSION_MAJOR = 0,
                VERSION_MINOR = 10,
                VERSION_PATCH = 2;
const char[]    VERSION_STRING =    "Ddbg
"~.toString(VERSION_MAJOR)~"."~(VERSION_MINOR>9?"":"0")~.toString(VERSION_MINOR)
                                   
~(VERSION_PATCH>0?"."~.toString(VERSION_PATCH):"")~" beta";
void main() {}


-- 
Jun 16 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1269


deewiant gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |deewiant gmail.com
           Keywords|                            |ice-on-valid-code
            Summary|Compiler crash on constant  |Compiler crash on assigning
                   |string concat               |to an element of a void-
                   |                            |initialized array in CTFE





Brought it down to this, nothing to do with strings but rather with the
attempted and failing CTFE of toString (here simplified and renamed f):

int f() {
        // this also causes the crash:
        // int[] a = void;
        int[1] a = void;
        a[0] = 1;
        return 1;
}

const i = f();

It's probably dependent on Issue 1254, but they're subtly different so I won't
set it as a dependency.


-- 
Jun 16 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1269


deewiant gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed in DMD 1.017.


-- 
Jun 26 2007