[analyzer] Variables with destructors are live until the destructor is run.
Test case in the next commit, which enables destructors under certain circumstances. llvm-svn: 160805
This commit is contained in:
@@ -455,6 +455,12 @@ LiveVariablesImpl::runOnBlock(const CFGBlock *block,
|
||||
for (CFGBlock::const_reverse_iterator it = block->rbegin(),
|
||||
ei = block->rend(); it != ei; ++it) {
|
||||
const CFGElement &elem = *it;
|
||||
|
||||
if (const CFGAutomaticObjDtor *Dtor = dyn_cast<CFGAutomaticObjDtor>(&elem)){
|
||||
val.liveDecls = DSetFact.add(val.liveDecls, Dtor->getVarDecl());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isa<CFGStmt>(elem))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user