llvm-project/clang/lib/StaticAnalyzer/Core
Jordan Rose 19bc88c3d4 [analyzer] Fix a use-after-free introduced in r168019.
In code like this:

void foo() {
     bar();
     baz();
}

...the location for the call to 'bar()' was being used as a backup location
for the call to 'baz()'. This is fine unless the call to 'bar()' is deemed
uninteresting and that part of the path deleted.

(This looks like a logic error as well, but in practice the only way 'baz()'
could have an invalid location is if the entire body of 'foo()' is
synthesized, meaning the call to 'bar()' will be using the location of the
call to 'foo()' anyway. Nevertheless, the new version better matches the
intent of the code.)

Found by Matt Beaumont-Gay using ASan. Thanks, Matt!

llvm-svn: 168080
2012-11-15 20:10:05 +00:00
..
APSIntType.cpp [analyzer] Rework both constraint managers to handle mixed-type comparisons. 2012-05-08 03:27:16 +00:00
AnalysisManager.cpp Have AnalyzerOptions::getBooleanOption() stick the matching config 2012-10-01 18:28:19 +00:00
AnalyzerOptions.cpp [analyzer] New option to not suppress null return paths if an argument is null. 2012-10-29 17:31:59 +00:00
BasicValueFactory.cpp [analyzer] Disallow creation of int vals with explicit bit width / signedness. 2012-09-01 17:39:24 +00:00
BlockCounter.cpp Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at. 2011-08-12 23:37:29 +00:00
BugReporter.cpp [analyzer] Fix a use-after-free introduced in r168019. 2012-11-15 20:10:05 +00:00
BugReporterVisitors.cpp [analyzer] New option to not suppress null return paths if an argument is null. 2012-10-29 17:31:59 +00:00
CMakeLists.txt Remove ProgramState::getSymVal(). It was being misused by Checkers, 2012-09-07 22:31:01 +00:00
CallEvent.cpp [analyzer] Add some convenience accessors to CallEvent, and use them. 2012-11-02 23:49:29 +00:00
Checker.cpp Reapply r149311 which I reverted by mistake. 2012-01-31 02:23:28 +00:00
CheckerContext.cpp [analyzer] Add some convenience accessors to CallEvent, and use them. 2012-11-02 23:49:29 +00:00
CheckerHelpers.cpp Split 'include/clang/StaticAnalyzer' into 'include/clang/StaticAnalyzer/Core' and 'include/clang/StaticAnalyzer/Checkers'. 2011-02-10 01:03:03 +00:00
CheckerManager.cpp [analyzer] Refactor: Remove Pred from NodeBuilderContext. 2012-11-03 02:54:11 +00:00
CheckerRegistry.cpp Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line. 2012-02-07 22:29:24 +00:00
ConstraintManager.cpp [analyzer] Let ConstraintManager subclasses provide a more efficient checkNull. 2012-10-31 16:44:55 +00:00
CoreEngine.cpp [analyzer] Refactor: Remove Pred from NodeBuilderContext. 2012-11-03 02:54:11 +00:00
Environment.cpp [analyzer] Mark symbol values as dead in the environment. 2012-11-15 19:11:27 +00:00
ExplodedGraph.cpp [analyzer] Use the CallEnter node to get a value for tracked null arguments. 2012-10-29 17:31:53 +00:00
ExprEngine.cpp [analyzer] Mark symbol values as dead in the environment. 2012-11-15 19:11:27 +00:00
ExprEngineC.cpp [analyzer] Fix a crash PR13762. 2012-09-05 22:31:58 +00:00
ExprEngineCXX.cpp [analyzer] Assume 'new' never returns NULL if it could throw an exception. 2012-10-20 02:32:51 +00:00
ExprEngineCallAndReturn.cpp [analyzer] Report leaks at the closing brace of a function body. 2012-11-15 19:11:43 +00:00
ExprEngineObjC.cpp [analyzer] Allow ObjC ivar lvalues where the base is nil. 2012-10-01 19:07:22 +00:00
FunctionSummary.cpp [analyzer] Record the basic blocks covered by the analyzes run. 2012-04-03 02:05:47 +00:00
HTMLDiagnostics.cpp Split library clangRewrite into clangRewriteCore and clangRewriteFrontend. 2012-09-01 05:09:24 +00:00
Makefile
MemRegion.cpp Reapply "[analyzer] Treat fields of unions as having symbolic offsets." 2012-10-10 23:23:21 +00:00
PathDiagnostic.cpp [analyzer] Report leaks at the closing brace of a function body. 2012-11-15 19:11:43 +00:00
PlistDiagnostics.cpp [analyzer] Embed the analyzer version into the plist output. 2012-10-15 22:48:19 +00:00
ProgramState.cpp [analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h 2012-11-05 16:58:00 +00:00
RangeConstraintManager.cpp [analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h 2012-11-05 16:58:00 +00:00
RegionStore.cpp [analyzer] When invalidating symbolic offset regions, take fields into account. 2012-11-10 01:40:08 +00:00
SValBuilder.cpp Rename 'getConjuredSymbol*' to 'conjureSymbol*'. 2012-08-22 06:26:06 +00:00
SVals.cpp [analyzer] Teach the analyzer about implicit initialization of statics 2012-09-17 19:13:56 +00:00
SimpleConstraintManager.cpp [analyzer] Make ProgramStateManager's SubEngine parameter optional. 2012-10-01 16:53:40 +00:00
SimpleConstraintManager.h [analyzer] Make ProgramStateManager's SubEngine parameter optional. 2012-10-01 16:53:40 +00:00
SimpleSValBuilder.cpp Remove unnecessary ASTContext& parameter from SymExpr::getType(). 2012-09-26 06:00:14 +00:00
Store.cpp [analyzer] Push evalDynamicCast and evalDerivedToBase up to Store. 2012-10-03 01:08:32 +00:00
SubEngine.cpp Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:48:34 +00:00
SymbolManager.cpp [analyzer] Run remove dead on end of path. 2012-11-03 02:54:20 +00:00
TextPathDiagnostics.cpp [analyzer] Ensure that PathDiagnostics profile the same regardless of path. 2012-08-31 00:36:26 +00:00