Fixed calling of final methods of interfaces

This commit is contained in:
Alexey Prokhin
2010-12-17 12:55:28 +03:00
parent 8c0902ce21
commit 349a6c1c3f

View File

@@ -1147,9 +1147,8 @@ DValue* DotVarExp::toElem(IRState* p)
LLValue* vthis2 = 0;
if (e1type->ty == Tclass) {
TypeClass* tc = (TypeClass*)e1type;
if (tc->sym->isInterfaceDeclaration()) {
if (tc->sym->isInterfaceDeclaration() && !fdecl->isFinal())
vthis2 = DtoCastInterfaceToObject(l, NULL)->getRVal();
}
}
LLValue* vthis = l->getRVal();
if (!vthis2) vthis2 = vthis;
@@ -1157,7 +1156,7 @@ DValue* DotVarExp::toElem(IRState* p)
//
// decide whether this function needs to be looked up in the vtable
//
bool vtbllookup = fdecl->isAbstract() || (!fdecl->isFinal() && fdecl->isVirtual());
bool vtbllookup = !fdecl->isFinal() && (fdecl->isAbstract() || fdecl->isVirtual());
// even virtual functions are looked up directly if super or DotTypeExp
// are used, thus we need to walk through the this expression and check