Handle CFGAutomaticObjDtor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119897 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp
index ddd3d50..4483cdb 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/lib/Checker/GRExprEngine.cpp
@@ -718,6 +718,8 @@
void GRExprEngine::ProcessImplicitDtor(const CFGImplicitDtor D,
GRStmtNodeBuilder &builder) {
+ Builder = &builder;
+
switch (D.getDtorKind()) {
case CFGElement::AutomaticObjectDtor:
ProcessAutomaticObjDtor(cast<CFGAutomaticObjDtor>(D), builder);
@@ -738,6 +740,17 @@
void GRExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor D,
GRStmtNodeBuilder &builder) {
+ ExplodedNode *Pred = builder.getBasePredecessor();
+ const GRState *state = Pred->getState();
+ const VarDecl *VD = D.getVarDecl();
+ const CXXRecordDecl *CD = VD->getType()->getAsCXXRecordDecl();
+ const CXXDestructorDecl *DD = CD->getDestructor();
+
+ Loc Dest = state->getLValue(VD, Pred->getLocationContext());
+
+ ExplodedNodeSet Dst;
+ VisitCXXDestructor(DD, cast<loc::MemRegionVal>(Dest).getRegion(),
+ D.getTriggerStmt(), Pred, Dst);
}
void GRExprEngine::ProcessBaseDtor(const CFGBaseDtor D,