From b2b013d929bf51680fee8d3686695d2ba3a7544e Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 28 Aug 2008 20:17:21 +0200 Subject: [PATCH] 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 --- gen/toir.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index 6edabf40..de0d74bb 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -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; } }