Bug 6803 – std.format.doFormat segfault with shared arguments

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-10-11T13:33:00Z
Last change time
2014-03-19T21:28:14Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2011-10-11T13:33:00Z
---- 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 by lt.infiltrator — 2014-03-19T21:28:14Z
This compiles and runs without errors as of v2.065.