llvm-project/clang/lib/Analysis
Kristof Umann b8ac93c73b [analyzer] PR43102: Fix an assertion and an out-of-bounds error for diagnostic location construction
Summary:
https://bugs.llvm.org/show_bug.cgi?id=43102

In today's edition of "Is this any better now that it isn't crashing?", I'd like to show you a very interesting test case with loop widening.

Looking at the included test case, it's immediately obvious that this is not only a false positive, but also a very bad bug report in general. We can see how the analyzer mistakenly invalidated `b`, instead of its pointee, resulting in it reporting a null pointer dereference error. Not only that, the point at which this change of value is noted at is at the loop, rather then at the method call.

It turns out that `FindLastStoreVisitor` works correctly, rather the supplied explodedgraph is faulty, because `BlockEdge` really is the `ProgramPoint` where this happens.
{F9855739}
So it's fair to say that this needs improving on multiple fronts. In any case, at least the crash is gone.

Full ExplodedGraph: {F9855743}

Reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, dcoughlin, rnkovacs, TWeaver

Subscribers: JesperAntonsson, uabelho, Ka-Ka, bjope, whisperity, szepet, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66716

llvm-svn: 372269
2019-09-18 22:24:26 +00:00
..
plugins [analyzer][NFC] Fix inconsistent references to checkers as "checks" 2019-09-12 19:09:24 +00:00
AnalysisDeclContext.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
BodyFarm.cpp [analyzer] Fix more analyzer warnings on analyzer and libAnalysis. 2019-08-28 21:19:58 +00:00
CFG.cpp [CFG] Add dumps for CFGElement and CFGElementRef 2019-09-12 19:52:34 +00:00
CFGReachabilityAnalysis.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CFGStmtMap.cpp [CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *. 2019-05-24 01:34:22 +00:00
CMakeLists.txt [analyzer] NFC: Move PathDiagnostic classes to libAnalysis. 2019-09-11 20:54:27 +00:00
CallGraph.cpp [CallGraph] Take into accound calls that aren't within any function bodies. 2019-08-20 02:22:37 +00:00
CloneDetection.cpp [clang] Use the new Regex::isValid() with no parameter 2019-08-20 16:07:31 +00:00
CocoaConventions.cpp [analyzer] Fix more analyzer warnings on analyzer and libAnalysis. 2019-08-28 21:19:58 +00:00
CodeInjector.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ConstructionContext.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Consumed.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
Dominators.cpp Make a buildbot using a buggy gcc happy 2019-07-03 12:06:10 +00:00
ExprMutationAnalyzer.cpp [analyzer] handle modification of vars inside an expr with comma operator 2019-03-07 15:50:52 +00:00
LiveVariables.cpp [CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *. 2019-05-24 01:34:22 +00:00
ObjCNoReturn.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PathDiagnostic.cpp [analyzer] PR43102: Fix an assertion and an out-of-bounds error for diagnostic location construction 2019-09-18 22:24:26 +00:00
PostOrderCFGView.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ProgramPoint.cpp [analyzer] exploded-graph-rewriter: Improve source location dumps. 2019-07-12 02:10:33 +00:00
ReachableCode.cpp [CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *. 2019-05-24 01:34:22 +00:00
RetainSummaryManager.cpp [analyzer] Fix more analyzer warnings on analyzer and libAnalysis. 2019-08-28 21:19:58 +00:00
ThreadSafety.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
ThreadSafetyCommon.cpp Thread Safety: also look at ObjC methods 2019-03-25 20:06:32 +00:00
ThreadSafetyLogical.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ThreadSafetyTIL.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
UninitializedValues.cpp [OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP programs. 2019-07-11 14:54:17 +00:00