digitalmars.D.bugs - [Issue 6713] New: Segfault with typeid of an alias
- d-bugmail puremagic.com (37/37) Sep 22 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6713
- d-bugmail puremagic.com (15/15) Jan 28 2012 http://d.puremagic.com/issues/show_bug.cgi?id=6713
http://d.puremagic.com/issues/show_bug.cgi?id=6713 Summary: Segfault with typeid of an alias Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: clugdbug yahoo.com.au --- Comment #0 from Don <clugdbug yahoo.com.au> 2011-09-22 03:44:21 PDT --- From the test suite, test1() in testtypeid.d, if 'typedef' is replaced by 'alias', a runtime segfault occurs. It works if typedef is used instead. import std.stdio; class ABC { } alias ABC DEF; // typedef ABC DEF; is OK. TypeInfo foo() { ABC c; return typeid(DEF); } void main() { TypeInfo ti = foo(); TypeInfo_Typedef td = cast(TypeInfo_Typedef)ti; assert(td); ti = td.base; TypeInfo_Class tc = cast(TypeInfo_Class)ti; assert(tc); printf("%.*s\n", tc.info.name.length, tc.info.name.ptr); assert(tc.info.name == "testtypeid.ABC"); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 22 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6713 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |INVALID --- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2012-01-28 15:25:47 PST --- The problem is this line: TypeInfo_Typedef td = cast(TypeInfo_Typedef)ti; ti is a TypeInfo_Class. There is no TypeInfo_Alias, and an alias isn't a TypeInfo_Typedef. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 28 2012