diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-08-03 23:09:01 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-08-03 23:09:01 +0000 |
commit | cfb4eb293fd8be1d3d247690f65606836431d1c1 (patch) | |
tree | e1241953b9bcb7d48ad8745d9c310a6e2e5625d4 /clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp | |
parent | 3eb3cd45b82855486b79e6a01add7899f07970fb (diff) | |
download | bcm5719-llvm-cfb4eb293fd8be1d3d247690f65606836431d1c1.tar.gz bcm5719-llvm-cfb4eb293fd8be1d3d247690f65606836431d1c1.zip |
[analyzer] When a symbol is null, we should track its constraints.
Because of this, we would previously emit NO path notes when a parameter
is constrained to null (because there are no stores). Now we show where we
made the assumption, which is much more useful.
llvm-svn: 161280
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp index a0022541f98..a94d7a773ec 100644 --- a/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp @@ -166,10 +166,8 @@ void DereferenceChecker::reportBug(ProgramStateRef State, const Stmt *S, buf.empty() ? BT_null->getDescription() : buf.str(), N); - report->addVisitor( - bugreporter::getTrackNullOrUndefValueVisitor(N, - bugreporter::GetDerefExpr(N), - report)); + bugreporter::addTrackNullOrUndefValueVisitor(N, bugreporter::GetDerefExpr(N), + report); for (SmallVectorImpl<SourceRange>::iterator I = Ranges.begin(), E = Ranges.end(); I!=E; ++I) @@ -193,8 +191,9 @@ void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S, BugReport *report = new BugReport(*BT_undef, BT_undef->getDescription(), N); - report->addVisitor(bugreporter::getTrackNullOrUndefValueVisitor(N, - bugreporter::GetDerefExpr(N), report)); + bugreporter::addTrackNullOrUndefValueVisitor(N, + bugreporter::GetDerefExpr(N), + report); report->disablePathPruning(); C.EmitReport(report); } |