mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-11 09:54:09 +02:00
Issue #426 part 2. Generate a try-finally block only if it is required
(i.e. there are actually some destructor calls that are needed to be put into finally)
This commit is contained in:
@@ -1055,7 +1055,7 @@ void DtoVarDeclaration(VarDeclaration* vd)
|
||||
{
|
||||
vd->ir.irLocal->value = val;
|
||||
}
|
||||
goto Lexit;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1087,15 +1087,6 @@ void DtoVarDeclaration(VarDeclaration* vd)
|
||||
ex->exp->toElem(gIR);
|
||||
}
|
||||
}
|
||||
|
||||
Lexit:
|
||||
/* Mark the point of construction of a variable that needs to be destructed.
|
||||
*/
|
||||
if (vd->edtor && !vd->noscope)
|
||||
{
|
||||
// Put vd on list of things needing destruction
|
||||
gIR->varsInScope().push_back(vd);
|
||||
}
|
||||
}
|
||||
|
||||
DValue* DtoDeclarationExp(Dsymbol* declaration)
|
||||
|
||||
Reference in New Issue
Block a user