[Issue 7527] New: [CTFE] Segfault when slicing a pointer at compile time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Feb 16 15:35:20 PST 2012
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: nobody at puremagic.com
ReportedBy: robert at octarineparrot.com
--- Comment #0 from Robert Clipsham <robert at 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: -------
More information about the Digitalmars-d-bugs
mailing list