[Issue 2536] New: ClassInfo.interfaces contains null sub-ClassInfos

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 22 06:01:44 PST 2008


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

           Summary: ClassInfo.interfaces contains null sub-ClassInfos
           Product: DGCC aka GDC
           Version: 0.24
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: blocker
          Priority: P2
         Component: glue layer
        AssignedTo: dvdfrdmn at users.sf.net
        ReportedBy: fvbommel at wxs.nl


See the following code:
-----
module test;

interface IConduit : InputStream {
}

interface InputStream {}

void main() {
    auto ci = IConduit.classinfo;
    // passes:
    assert(ci.interfaces.length == 1, "length not 1");
    // fails on gdc (but not dmd):
    assert(ci.interfaces[0].classinfo !is null, "value is null");
}
-----
Ubuntu 8.10 x86_64, gdc-4.2 from Ubuntu repository (4.2.4 20080705 (prerelease
gdc 0.25 20080312, using dmd 1.024) (Ubuntu 0.25-4.2.4-3.1)).

Both asserts pass on DMD (v1.024 and v1.038), but the second one fails when
compiled using GDC.

This is with Tango installed, in case it matters.

This causes segfaults in Tango's Buffer.share() (via cast(Buffered) ==>
_d_dynamic_cast ==> _d_isbaseof2) :(


-- 



More information about the D.gnu mailing list