http://d.puremagic.com/issues/show_bug.cgi?id=9130
Summary: Wrong codegen for comile time constructed struct
Product: D
Version: D2
Platform: x86
OS/Version: All
Status: NEW
Severity: critical
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Max Samukha <[email protected]> 2012-12-09 16:21:05
PST ---
This is the minimal test case I have for now. Wrong value is generated for the
'name' member causing the following to segfault at runtime (1):
struct S
{
void bar()
{
}
}
struct Meta
{
string name;
void construct(alias m)()
{
name = "bar";
}
}
struct Function
{
Meta super_;
alias super_ this;
bool break_;
void construct(alias f)()
{
super_.construct!f();
}
void dynConstruct(alias f)()
{
if (!break_)
{
break_ = true;
meta!(__traits(getOverloads, S, "bar")[0]);
}
}
}
@property void meta(alias m)()
{
static Function md = function()
{
Function r;
r.construct!m();
return r;
}();
assert(md.name == "bar"); // (1)
md.dynConstruct!m();
}
void main()
{
meta!(S.bar);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------