[Issue 2637] New: Segfault using + inside char [] function parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 1 10:12:13 PST 2009


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

           Summary: Segfault  using + inside char [] function parameter
           Product: D
           Version: 1.039
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au


Original bug reported by Zorran. This is a slightly simplified version.

---
void foo(char []x) {}

void main() {
    foo("x"+null);
}
----
bug.d(5): Error: Array operations not implemented
SEGFAULT

Zorran's example:
----
import std.stdio;

void main()
{
        string ss="sample";
        printf("%s", cast(char*)(ss+"\0") );
}


-- 



More information about the Digitalmars-d-bugs mailing list