Changed some hardcoded offset/alignment for classes in DMD, broke offsets for 64bits.

Changed ClassInfo generation to no longer access the default initializer of ClassInfo, fixes problems with index mismatch.
This commit is contained in:
Tomas Lindquist Olsen
2008-11-30 20:22:09 +01:00
parent 81eded2ece
commit 577237e073
5 changed files with 136 additions and 149 deletions

View File

@@ -551,8 +551,8 @@ void ClassDeclaration::semantic(Scope *sc)
// sc->offset += PTRSIZE; // room for uplevel context pointer
}
else
{ sc->offset = 8; // allow room for vptr[] and monitor
alignsize = 4;
{ sc->offset = 2*PTRSIZE; // allow room for vptr[] and monitor
alignsize = PTRSIZE;
}
structsize = sc->offset;
Scope scsave = *sc;
@@ -1139,7 +1139,7 @@ void InterfaceDeclaration::semantic(Scope *sc)
sc->linkage = LINKwindows;
sc->structalign = 8;
structalign = sc->structalign;
sc->offset = 8;
sc->offset = 2*PTRSIZE;
inuse++;
for (i = 0; i < members->dim; i++)
{