summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-08-03 23:31:15 +0000
committerJordan Rose <jordan_rose@apple.com>2012-08-03 23:31:15 +0000
commit17a8757a46ede9028024211d293bb473ae3de5ff (patch)
treef14a0647de38d870bda7b3bf4eaccefda15e0d64 /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
parent874886cd66261b7e5039a975769503f53cdd42db (diff)
downloadbcm5719-llvm-17a8757a46ede9028024211d293bb473ae3de5ff.tar.gz
bcm5719-llvm-17a8757a46ede9028024211d293bb473ae3de5ff.zip
[analyzer] Update initializer assertion for delegating constructors.
Like base constructors, delegating constructors require no further processing in the CFGInitializer node. Also, add PrettyStackTraceLoc to the initializer and destructor logic so we can get better stack traces in the future. llvm-svn: 161283
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngine.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
index b46dc49a1bf..b0435fb562e 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -360,8 +360,13 @@ void ExprEngine::ProcessInitializer(const CFGInitializer Init,
ProgramStateRef State = Pred->getState();
- // We don't set EntryNode and currentStmt. And we don't clean up state.
const CXXCtorInitializer *BMI = Init.getInitializer();
+
+ PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
+ BMI->getSourceLocation(),
+ "Error evaluating initializer");
+
+ // We don't set EntryNode and currentStmt. And we don't clean up state.
const StackFrameContext *stackFrame =
cast<StackFrameContext>(Pred->getLocationContext());
const CXXConstructorDecl *decl =
@@ -383,7 +388,7 @@ void ExprEngine::ProcessInitializer(const CFGInitializer Init,
State = State->bindLoc(FieldLoc, InitVal);
}
} else {
- assert(BMI->isBaseInitializer());
+ assert(BMI->isBaseInitializer() || BMI->isDelegatingInitializer());
// We already did all the work when visiting the CXXConstructExpr.
}
OpenPOWER on IntegriCloud