From 0521f8075c567a7fc7e03ea2bb45916d57c1ad68 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Thu, 16 Apr 2009 21:00:49 +0200 Subject: [PATCH] Too strict assertion with generating the interfaceInfosZ symbol. Baseclasses might introduce interfaces. --- ir/irclass.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ir/irclass.cpp b/ir/irclass.cpp index 6643fc89..81dc1c17 100644 --- a/ir/irclass.cpp +++ b/ir/irclass.cpp @@ -81,19 +81,15 @@ LLGlobalVariable * IrStruct::getInterfaceArraySymbol() ClassDeclaration* cd = aggrdecl->isClassDeclaration(); - // FIXME: - // also happens for mini/s.d :( - assert(cd->vtblInterfaces && cd->vtblInterfaces->dim > 0 && - "should not create interface info array for class with no explicit " - "interface implementations"); + size_t n = type->irtype->isClass()->getNumInterfaceVtbls(); + assert(n > 0 && "getting ClassInfo.interfaces storage symbol, but we " + "don't implement any interfaces"); VarDeclarationIter idx(ClassDeclaration::classinfo->fields, 3); const llvm::Type* InterfaceTy = DtoType(idx->type->next); // create Interface[N] - const llvm::ArrayType* array_type = llvm::ArrayType::get( - InterfaceTy, - type->irtype->isClass()->getNumInterfaceVtbls()); + const llvm::ArrayType* array_type = llvm::ArrayType::get(InterfaceTy,n); // put it in a global std::string name("_D");