Fixed some problems with the addZeros forward declarations having type mismatches.

This commit is contained in:
Tomas Lindquist Olsen 2008-11-29 20:57:52 +01:00
parent 3a2e29d434
commit 4da2cf066e
5 changed files with 7 additions and 11 deletions

View file

@ -421,10 +421,6 @@ void DtoDeclareClass(ClassDeclaration* cd)
DtoTypeInfoOf(cd->type, false);
}
//////////////////////////////////////////////////////////////////////////////////////////
void addZeros(std::vector<llvm::Constant*>& inits, size_t pos, size_t offset); // irstruct.cpp
//////////////////////////////////////////////////////////////////////////////
// adds data fields and interface vtables to the constant initializer of class cd
@ -547,6 +543,9 @@ static void init_class_vtbl_initializer(ClassDeclaration* cd)
FuncDeclaration* fd = dsym->isFuncDeclaration();
assert(fd);
// if function is abstract,
// or class is abstract, and func has no body,
// emit a null vtbl entry
if (fd->isAbstract() || (cd->isAbstract() && !fd->fbody))
{
sinits[k] = getNullPtr(getVoidPtrType());