Mercurial > projects > ldc
diff ir/irclass.cpp @ 1249:871ae029ff49
Do not emit declare or emit a vtbl entry for bodyless functions in abstract classes.
Maybe the better fix would be to adjust FuncDeclaration::isAbstract, but there
may be unwelcome sideeffects.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 19 Apr 2009 00:06:23 +0200 |
parents | fc579f389f9a |
children | 752bed475b75 |
line wrap: on
line diff
--- a/ir/irclass.cpp Fri Apr 17 17:16:55 2009 +0200 +++ b/ir/irclass.cpp Sun Apr 19 00:06:23 2009 +0200 @@ -132,7 +132,7 @@ FuncDeclaration* fd = dsym->isFuncDeclaration(); assert(fd && "vtbl entry not a function"); - if (fd->isAbstract() && !fd->fbody) + if ((cd->isAbstract() || fd->isAbstract()) && !fd->fbody) { c = getNullValue(DtoType(fd->type->pointerTo())); } @@ -335,7 +335,7 @@ FuncDeclaration* fd = dsym->isFuncDeclaration(); assert(fd && "vtbl entry not a function"); - assert(!(fd->isAbstract() && !fd->fbody) && + assert(!((fd->isAbstract() || cd->isAbstract()) && !fd->fbody) && "null symbol in interface implementation vtable"); fd->codegen(Type::sir);