digitalmars.D.bugs - [Issue 1586] New: DMD and GDC segfaults on incomplete code segment.
- d-bugmail puremagic.com (26/26) Oct 16 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1586
- d-bugmail puremagic.com (9/9) Oct 19 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1586
- d-bugmail puremagic.com (20/20) Oct 28 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1586
- d-bugmail puremagic.com (13/13) Dec 13 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1586
- d-bugmail puremagic.com (4/4) May 07 2009 http://d.puremagic.com/issues/show_bug.cgi?id=1586
- d-bugmail puremagic.com (10/10) May 14 2009 http://d.puremagic.com/issues/show_bug.cgi?id=1586
- d-bugmail puremagic.com (9/9) May 14 2009 http://d.puremagic.com/issues/show_bug.cgi?id=1586
http://d.puremagic.com/issues/show_bug.cgi?id=1586 Summary: DMD and GDC segfaults on incomplete code segment. Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: hoytak cs.ubc.ca Hello, A typo revealed a way to make the compiler segfault. Trying to compile the following incomplete code segment as a complete module causes the official D compiler (versions 1.022 and 2.005) and GDC 0.24 to segfault. //////////// module badcode; void myFunc() { auto func = &NotHere!(1).Bar!(k); // NotHere is not defined. } ///////////// Thanks! --Hoyt --
Oct 16 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1586 ------- Comment #1 from thomas-dloop kuehne.cn 2007-10-20 01:55 ------- Added to DStress as http://dstress.kuehne.cn/nocompile/t/template_66_A.d http://dstress.kuehne.cn/nocompile/t/template_66_B.d http://dstress.kuehne.cn/nocompile/t/template_66_C.d http://dstress.kuehne.cn/nocompile/t/template_66_D.d http://dstress.kuehne.cn/nocompile/t/template_66_E.d --
Oct 19 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1586 ------- Comment #2 from braddr puremagic.com 2007-10-28 04:10 ------- The segv is in this code: Expression *DotTemplateInstanceExp::semantic(Scope *sc) ... if (!s2) { error("template identifier %s is not a member of %s %s", id->toChars(), s->kind(), s->ident ? s->ident->toChars() : "(null)"); goto Lerr; } ... s->ident is null, so s->ident->toChars() is invalid. I added the ?: expression to validate that, and here's the resulting error message: /home/braddr/sandbox/d/bugs/bug1586.d:5: template instance identifier 'NotHere' is not defined /home/braddr/sandbox/d/bugs/bug1586.d:5: Error: template identifier Bar is not a member of template instance (null) My fix is wrong, but hopefully this will save Walter a few minutes of narrowing down. --
Oct 28 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1586 ------- Comment #3 from davidl 126.com 2007-12-14 00:30 ------- While I enjoy another fix: if (!s2) { if(s->ident) error("template identifier %s is not a member of %s %s", id->toChars(), s->kind(), s->ident->toChars() : "(null)"); goto Lerr; } Since the Template Instance is unknown so this error message is useless. --
Dec 13 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1586 ------- Comment #4 from clugdbug yahoo.com.au 2009-05-07 02:21 ------- Fixed in DMD2.028; not yet in D1. --
May 07 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1586 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug yahoo.com.au --- Comment #5 from Don <clugdbug yahoo.com.au> 2009-05-14 01:20:36 PDT --- Fixed DMD2.028 and 1.045. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 14 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1586 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 14 2009