Always call finalizer for stack classes. Checking for the number of

destructors of the class type is not sufficient: we may be holding a derived
class with a destructor.

Fixes: run/auto_07
This commit is contained in:
Christian Kamm
2008-08-28 20:17:21 +02:00
parent 0f92afc5b9
commit b2b013d929

View File

@@ -1520,8 +1520,7 @@ DValue* DeleteExp::toElem(IRState* p)
}
else if (DVarValue* vv = dval->isVar()) {
if (vv->var && vv->var->onstack) {
if (tc->sym->dtors.dim > 0)
DtoFinalizeClass(dval->getRVal());
DtoFinalizeClass(dval->getRVal());
onstack = true;
}
}