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

           Summary: [CTFE] Segfault when slicing a pointer at compile time
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: rob...@octarineparrot.com


--- Comment #0 from Robert Clipsham <rob...@octarineparrot.com> 2012-02-16 
23:35:18 GMT ---
When compiling the following code:
----
char[] replace(char[] subject)
{
    auto app = Appender();

    app.data.ptr[0..subject.length] = subject;
    return app.data;
}

struct Appender
{
    char[] data;
}
enum foo = replace("$a = ?".dup);
----
With dmd 2.058, dmd gives the following:
----
$ dmd test.d 
test.d(5): Error: pointer cast from char[] to char* is not supported at compile
time
Segmentation fault: 11
----

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

Reply via email to