From 17a8757a46ede9028024211d293bb473ae3de5ff Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 3 Aug 2012 23:31:15 +0000 Subject: [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 --- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp') 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(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. } -- cgit v1.2.3