[Issue 1811] New: TypeInfo usage leads to seg fault at runtime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 30 13:20:13 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1811

           Summary: TypeInfo usage leads to seg fault at runtime
           Product: D
           Version: 2.010
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: kamm-removethis at incasoftware.de


The code

import std.stdio;

class Base
{
    int foo() { return 0; }
}

class Sub : Base
{
    override int foo() { return 0; }
}

void main()
{
   auto t1 = typeid(typeof(Sub.foo));
   auto t2 = typeid(typeof(Base.foo)); // <- comment to fix

   t1.tsize(); // crash
}

compiles fine, but crashes when run.


-- 



More information about the Digitalmars-d-bugs mailing list