[Issue 934] Segfault taking mangleof a forward reference in a template.
http://d.puremagic.com/issues/show_bug.cgi?id=934 Don changed: What|Removed |Added Status|NEW |RESOLVED CC||clugd...@yahoo.com.au Resolution||FIXED --- Comment #4 from Don 2009-05-14 05:21:07 PDT --- Fixed DMD2.030 and 1.045 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 934] Segfault taking mangleof a forward reference in a template.
http://d.puremagic.com/issues/show_bug.cgi?id=934 clugd...@yahoo.com.au changed: What|Removed |Added Keywords||patch --- Comment #3 from clugd...@yahoo.com.au 2009-04-20 01:55 --- PATCH: DMD2.028 on mytype.c line 1272, replace assert(deco); with: if (!deco) { error(loc, ".mangleof forward reference"); return new StringExp(loc, "ERROR", 5, 'c'); } --- I was surprised to find that in most cases, this error doesn't appear -- seems the compiler absorbs the error and retries in the next semantic pass, and then the code works correctly. In other words, it completely fixes the bug in D2. >From the line number, seems it's a different cause in D1. --
[Issue 934] Segfault taking mangleof a forward reference in a template.
http://d.puremagic.com/issues/show_bug.cgi?id=934 clugd...@yahoo.com.au changed: What|Removed |Added Summary|forward reference by|Segfault taking mangleof a |pragma(msg) in template:|forward reference in a |"mtype.c:550: virtual |template. |Expression* | |Type::getProperty(Loc, | |Identifier*): Assertion | |`deco' failed" | --- Comment #2 from clugd...@yahoo.com.au 2009-04-16 04:05 --- Actually it's nothing to do with pragma(msg). It's the mangleof which is the problem. Change it to .stringof and problem disappears. template Templ(T) { const char [] XXX = Type.mangleof; alias T Type; } void main() { Templ!(int).Type x; // instantiate } Segfaults on DMD2.028. assert mtype.c(1272) deco DMD1.042 Assertion failure: 'deco' on line 576 in file 'mtype.c' abnormal program termination --