Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
1247:2a92c115461d | 1249:871ae029ff49 |
---|---|
130 assert(dsym && "null vtbl member"); | 130 assert(dsym && "null vtbl member"); |
131 | 131 |
132 FuncDeclaration* fd = dsym->isFuncDeclaration(); | 132 FuncDeclaration* fd = dsym->isFuncDeclaration(); |
133 assert(fd && "vtbl entry not a function"); | 133 assert(fd && "vtbl entry not a function"); |
134 | 134 |
135 if (fd->isAbstract() && !fd->fbody) | 135 if ((cd->isAbstract() || fd->isAbstract()) && !fd->fbody) |
136 { | 136 { |
137 c = getNullValue(DtoType(fd->type->pointerTo())); | 137 c = getNullValue(DtoType(fd->type->pointerTo())); |
138 } | 138 } |
139 else | 139 else |
140 { | 140 { |
333 } | 333 } |
334 | 334 |
335 FuncDeclaration* fd = dsym->isFuncDeclaration(); | 335 FuncDeclaration* fd = dsym->isFuncDeclaration(); |
336 assert(fd && "vtbl entry not a function"); | 336 assert(fd && "vtbl entry not a function"); |
337 | 337 |
338 assert(!(fd->isAbstract() && !fd->fbody) && | 338 assert(!((fd->isAbstract() || cd->isAbstract()) && !fd->fbody) && |
339 "null symbol in interface implementation vtable"); | 339 "null symbol in interface implementation vtable"); |
340 | 340 |
341 fd->codegen(Type::sir); | 341 fd->codegen(Type::sir); |
342 assert(fd->ir.irFunc && "invalid vtbl function"); | 342 assert(fd->ir.irFunc && "invalid vtbl function"); |
343 | 343 |