summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/MallocChecker.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add a new symbol type, SymbolExtent, to represent the extents of memory ↵Jordy Rose2010-07-041-5/+13
| | | | | | | | | | regions that may not be known at compile-time (such as those created by malloc). This replaces the old setExtent/getExtent API on Store, which used the GRState's GDM to store SVals. Also adds a getKnownValue() method to SValuator, which gets the integer value of an SVal if it is known to only have one possible value. There are more places in the code that could be using this, but in general we want to be dealing entirely in SVals, so its usefulness is limited. The only visible functionality change is that extents are now honored for any DeclRegion, such as fields and Objective-C ivars, rather than just variables. This shows up in bounds-checking and cast-size-checking. llvm-svn: 107577
* Fix PR 7475 by enhancing the static analyzer to also invalidate bindings for ↵Ted Kremenek2010-07-011-1/+2
| | | | | | | | | | | non-static global variables when calling a function/method whose impact on global variables we cannot accurately estimate. This change introduces two new MemSpaceRegions that divide up the memory space of globals, and causes RegionStore and BasicStore to consult a binding to the NonStaticGlobalsMemSpaceRegion when lazily determining the value of a global. llvm-svn: 107423
* Add an ivar to SymbolReaper for the current statement, and then stop passing ↵Jordy Rose2010-07-011-3/+2
| | | | | | the current statement around everywhere. Preparation for symbolic extents. llvm-svn: 107422
* Code cleanup: remove explicit flush() in favor of using the ostream's str()Jordy Rose2010-06-081-2/+1
| | | | llvm-svn: 105657
* Catch free()s on non-regions and regions known to be not from malloc(), by ↵Jordy Rose2010-06-071-5/+180
| | | | | | checking the symbol type and memory space. llvm-svn: 105547
* Add support for calloc() in MallocChecker. Patch by Jordy Rose, with my Zhongxing Xu2010-06-011-9/+43
| | | | | | modification. llvm-svn: 105264
* Relax an assertion. Various cases could lead to non-symbol values.Zhongxing Xu2010-05-131-1/+4
| | | | llvm-svn: 103707
* Checker: random include cleanup.Benjamin Kramer2010-03-271-0/+1
| | | | llvm-svn: 99731
* Add use-after-free check to MallocChecker.Zhongxing Xu2010-03-101-1/+23
| | | | llvm-svn: 98136
* Fix pr6293. If ptr is NULL, no operation is preformed.Zhongxing Xu2010-02-141-0/+5
| | | | llvm-svn: 96154
* Revert 95541.Ted Kremenek2010-02-081-7/+6
| | | | llvm-svn: 95545
* Rename: GRState::getSVal(Stmt*) => getExprVal(),Zhongxing Xu2010-02-081-6/+7
| | | | | | GRState::getSVal(MemRegion*) => Load(). llvm-svn: 95541
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-251-0/+336
(1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. llvm-svn: 94406
OpenPOWER on IntegriCloud