Don't destruct a temporary if its constructor throws.

This commit is contained in:
Martin 2015-07-19 01:01:04 +02:00
parent b9c77c266a
commit 6fefec5a07
3 changed files with 48 additions and 2 deletions

View file

@ -76,6 +76,11 @@ bool FuncGen::hasTemporariesToDestruct()
return !temporariesToDestruct.empty();
}
VarDeclarations& FuncGen::getTemporariesToDestruct()
{
return temporariesToDestruct;
}
void FuncGen::destructTemporaries(unsigned numToKeep)
{
// pop one temporary after the other from the temporariesToDestruct stack