Mercurial > projects > ldc
changeset 1235:ded6a557220a
Too strict assertion with generating the interfaceInfosZ symbol. Baseclasses might introduce interfaces.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Thu, 16 Apr 2009 21:00:49 +0200 |
parents | 9201e0d41ee5 |
children | 57db55766118 |
files | ir/irclass.cpp |
diffstat | 1 files changed, 4 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ir/irclass.cpp Thu Apr 16 20:41:27 2009 +0200 +++ b/ir/irclass.cpp Thu Apr 16 21:00:49 2009 +0200 @@ -81,19 +81,15 @@ 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");