aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngineCXX.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngineCXX.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
index d1a591c7fe..0fedf255d6 100644
--- a/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
@@ -331,20 +331,23 @@ void ExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred,
State = State->BindExpr(CNE, LCtx, symVal);
}
+ Bldr.generateNode(CNE, Pred, State);
+
// If the type is not a record, we won't have a CXXConstructExpr as an
// initializer. Copy the value over.
if (const Expr *Init = CNE->getInitializer()) {
if (!isa<CXXConstructExpr>(Init)) {
- QualType ObjTy = CNE->getType()->getAs<PointerType>()->getPointeeType();
- (void)ObjTy;
- assert(!ObjTy->isRecordType());
+ assert(Bldr.getResults().size() == 1);
+ ExplodedNode *TmpN = *Bldr.getResults().begin();
+ Bldr.takeNodes(TmpN);
+
+ assert(!CNE->getType()->getPointeeCXXRecordDecl());
+
SVal Location = State->getSVal(CNE, LCtx);
- if (Optional<Loc> LV = Location.getAs<Loc>())
- State = State->bindLoc(*LV, State->getSVal(Init, LCtx));
+ bool FirstInit = (Location == symVal);
+ evalBind(Dst, CNE, TmpN, Location, State->getSVal(Init, LCtx), FirstInit);
}
}
-
- Bldr.generateNode(CNE, Pred, State);
}
void ExprEngine::VisitCXXDeleteExpr(const CXXDeleteExpr *CDE,