mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 15:10:59 +03:00
Fix wrong assertion wrt. virtual function vtbl index (#3327)
Fixes #3324 by checking the aggregate linkage, not the function's, for special vtbl index 0.
This commit is contained in:
parent
f28f4b3680
commit
40914dc23f
2 changed files with 11 additions and 2 deletions
|
@ -426,9 +426,10 @@ LLValue *DtoVirtualFunctionPointer(DValue *inst, FuncDeclaration *fdecl,
|
|||
assert(fdecl->isVirtual());
|
||||
assert(!fdecl->isFinalFunc());
|
||||
assert(inst->type->toBasetype()->ty == Tclass);
|
||||
// 0 is always ClassInfo/Interface* unless it is a CPP interface
|
||||
// slot 0 is always ClassInfo/Interface* unless it is a CPP class
|
||||
assert(fdecl->vtblIndex > 0 ||
|
||||
(fdecl->vtblIndex == 0 && fdecl->linkage == LINKcpp));
|
||||
(fdecl->vtblIndex == 0 &&
|
||||
inst->type->toBasetype()->isTypeClass()->sym->isCPPclass()));
|
||||
|
||||
// get instance
|
||||
LLValue *vthis = DtoRVal(inst);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue