D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6803 - std.format.doFormat segfault with shared arguments
Summary: std.format.doFormat segfault with shared arguments
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 13:33 UTC by Martin Nowak
Modified: 2014-03-19 21:28 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 Martin Nowak 2011-10-11 13:33:00 UTC
----
import std.string;

shared size_t num;

void main()
{
    auto s = std.string.format("foo %s", num);
}

----

It seems like TypeInfo_Shared is interpreted as
TypeInfo_Struct and subsequently segfaults at line format.d(3932).

            case Mangle.Tstruct:
            {        TypeInfo_Struct tis = cast(TypeInfo_Struct)ti;
                if (tis.xtoString is null) // <- dereference of null pointer
Comment 1 Infiltrator 2014-03-19 21:28:14 UTC
This compiles and runs without errors as of v2.065.