D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7638 - [CTFE] std.array.replace causes a segfault at compile time while replacing the begining of a string
Summary: [CTFE] std.array.replace causes a segfault at compile time while replacing th...
Status: RESOLVED DUPLICATE of issue 7527
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: CTFE, diagnostic, ice
Depends on:
Blocks:
 
Reported: 2012-03-03 17:51 UTC by Kajtek
Modified: 2012-03-11 12:51 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kajtek 2012-03-03 17:51:22 UTC
The code:

    enum f = "foo";
    enum s0 = f.replace("oo", "bar");
    enum s1 = f.replace("fo", "bar");

...results in:

    /usr/include/d/dmd/phobos/std/array.d(2054): Error: pointer cast from char[] to char* is not supported at compile time
    Segmentation fault

...under DMD64 2.058 on Linux.

It seems to segfault while appending new characters only when replacing the begining of a string at compile time. Replacing anything else works just fine.
Comment 1 timon.gehr 2012-03-11 12:51:31 UTC

*** This issue has been marked as a duplicate of issue 7527 ***