llvm-project/clang/lib/StaticAnalyzer/Core
Anna Zaks 7c96b7db96 [analyzer] CStringChecker should not rely on the analyzer generating UndefOrUnknown value when it cannot reason about the expression.
We are now often generating expressions even if the solver is not known to be able to simplify it. This is another cleanup of the existing code, where the rest of the analyzer and checkers should not base their logic on knowing ahead of the time what the solver can reason about. 

In this case, CStringChecker is performing a check for overflow of 'left+right' operation. The overflow can be checked with either 'maxVal-left' or 'maxVal-right'. Previously, the decision was based on whether the expresion evaluated to undef or not. With this patch, we check if one of the arguments is a constant, in which case we know that 'maxVal-const' is easily simplified. (Another option is to use canReasonAbout() method of the solver here, however, it's currently is protected.)

This patch also contains 2 small bug fixes:
 - swap the order of operators inside SValBuilder::makeGenericVal.
 - handle a case when AddeVal is unknown in GenericTaintChecker::getPointedToSymbol.

llvm-svn: 146343
2011-12-11 18:43:40 +00:00
..
AggExprVisitor.cpp Switch assert(0/false) llvm_unreachable. 2011-09-23 05:06:16 +00:00
AnalysisManager.cpp Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses. 2011-10-24 01:32:45 +00:00
BasicConstraintManager.cpp [analyzer] Remove TransferFuncs.h, then deal with the fallout. 2011-09-02 08:02:59 +00:00
BasicValueFactory.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
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 Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer. 2011-10-14 18:45:37 +00:00
BugReporterVisitors.cpp Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer. 2011-10-14 18:45:37 +00:00
CMakeLists.txt [analyzer] Put CheckerConext::getCalleeName out of line. 2011-11-17 01:09:15 +00:00
Checker.cpp [analyzer] change "tag" in ProgramPoint from "void*" to a ProgramPointTag*. 2011-08-12 23:04:46 +00:00
CheckerContext.cpp [analyzer] Refactor checkers to use helper function for getting callee Decl and name. 2011-12-01 05:57:37 +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] Simplify CheckerContext 2011-10-25 19:57:06 +00:00
CheckerRegistry.cpp [analyzer] Overhaul of checker registration in preparation for basic plugin support. Removes support for checker groups (we can add them back in later if we decide they are still useful), and -analyzer-checker-help output is a little worse for the time being (no packages). 2011-08-16 21:24:21 +00:00
CoreEngine.cpp [analyzer] Make sink attribute part of the node profile. 2011-11-01 22:41:19 +00:00
Environment.cpp Move immutable map canonization out of the removeDeadBindings loop (via using ImmutableMapRef). Gives ~2% speedup. 2011-09-23 19:14:09 +00:00
ExplodedGraph.cpp [analyzer] Make sink attribute part of the node profile. 2011-11-01 22:41:19 +00:00
ExprEngine.cpp [analyzer] Unify SymbolVal and SymExprVal under a single SymbolVal 2011-12-05 18:58:30 +00:00
ExprEngineC.cpp [analyzer] Simplify the condition. 2011-12-05 21:33:01 +00:00
ExprEngineCXX.cpp [analyzer] Node builders cleanup + comments 2011-10-24 21:19:59 +00:00
ExprEngineCallAndReturn.cpp [analyzer] Remove unused headers. 2011-10-25 19:56:58 +00:00
ExprEngineObjC.cpp [analyzer] Node builders cleanup + comments 2011-10-24 21:19:59 +00:00
HTMLDiagnostics.cpp Renaming PathDiagnosticClients.h to PathDiagnosticConsumers.h (issue 5397) 2011-09-27 01:43:33 +00:00
Makefile
MemRegion.cpp Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses. 2011-10-24 01:32:45 +00:00
ObjCMessage.cpp [static analyzer] Fix crash in LiveVariables and Environment::getSVal() when analyzing C++ pointer-to-member calls. Fixes <rdar://problem/10243398>. 2011-10-06 20:53:28 +00:00
PathDiagnostic.cpp Fix various minor issues find via unreachable code warnings, from 2011-11-02 20:52:01 +00:00
PlistDiagnostics.cpp Renaming PathDiagnosticClients.h to PathDiagnosticConsumers.h (issue 5397) 2011-09-27 01:43:33 +00:00
ProgramState.cpp [analyzer] Introduce IntSymExpr, where the integer is on the lhs. 2011-12-10 23:36:51 +00:00
RangeConstraintManager.cpp [analyzer] Minor improvements on RangeConstraint pretty-printing. 2011-12-05 18:58:14 +00:00
RegionStore.cpp [analyzer] Refactor: Move symbol_iterator from SVal to SymExpr, use it 2011-12-06 23:12:33 +00:00
SValBuilder.cpp [analyzer] CStringChecker should not rely on the analyzer generating UndefOrUnknown value when it cannot reason about the expression. 2011-12-11 18:43:40 +00:00
SVals.cpp [analyzer] Refactor: Move symbol_iterator from SVal to SymExpr, use it 2011-12-06 23:12:33 +00:00
SimpleConstraintManager.cpp [analyzer] Unify SymbolVal and SymExprVal under a single SymbolVal 2011-12-05 18:58:30 +00:00
SimpleConstraintManager.h [analyzer] Mark ConstraintManager::canReasonAbout as protected. 2011-12-05 21:33:06 +00:00
SimpleSValBuilder.cpp [analyzer]Fixup r146336. 2011-12-10 23:42:38 +00:00
Store.cpp [analyzer] Propagate taint through NonLoc to NonLoc casts. 2011-12-06 23:12:27 +00:00
SymbolManager.cpp [analyzer] Introduce IntSymExpr, where the integer is on the lhs. 2011-12-10 23:36:51 +00:00
TextPathDiagnostics.cpp Renaming PathDiagnosticClients.h to PathDiagnosticConsumers.h (issue 5397) 2011-09-27 01:43:33 +00:00