- Dec 16, 2008
-
-
Ted Kremenek authored
- one queue (FIFO) to queue up nodes at block entrances - another queue (LIFO) to queue up other nodes - The idea is to explore basic blocks to completion, but to do a BFS exploration of blocks. llvm-svn: 61106
-
Ted Kremenek authored
- Added four new ProgramPoint types that subclass PostStmt for use in GRExprEngine::EvalLocation: - PostOutOfBoundsCheckFailed - PostUndefLocationCheckFailed - PostNullCheckFailed - PostLocationChecksSucceed These were created because of a horribly subtle caching bug in EvalLocation where a node representing an "bug condition" in EvalLocation (e.g. a null dereference) could be re-used as the "non-bug condition" because the Store did not contain any information to differentiate between the two. The extra program points just disables any accidental caching between EvalLocation and its callers. GRExprEngine: - EvalLocation now returns a NodeTy* instead of GRState*. This should be used as the "vetted" predecessor for EvalLoad/EvalStore. llvm-svn: 61105
-
Zhongxing Xu authored
llvm-svn: 61069
-
- Dec 15, 2008
-
-
Ted Kremenek authored
llvm-svn: 61039
-
- Dec 14, 2008
-
-
Zhongxing Xu authored
llvm-svn: 61003
-
- Dec 13, 2008
-
-
Ted Kremenek authored
- Overhauled the notion of "types" for TypedRegions. We now distinguish between the "lvalue" of a region (via getLValueRegion()) and the "rvalue" of a region (va getRValueRegion()). Since a region represents a chunk of memory it has both, but we were conflating these concepts in some cases, leading to some insidious bugs. - Removed AnonPointeeType, partially because it is unused and because it doesn't have a clear notion of lvalue vs rvalue type. We can add it back once there is a need for it and we can resolve its role with these concepts. StoreManager: - Overhauled StoreManager::CastRegion. It expects an *lvalue* type for a region. This is actually what motivated the overhaul to the MemRegion type mechanism. It also no longer returns an SVal; we can just return a MemRegion*. - BasicStoreManager::CastRegion now overlays an "AnonTypedRegion" for pointer-pointer casts. This matches with the MemRegion changes. - Similar changes to RegionStore, except I've added a bunch of FIXMEs where it wasn't 100% clear where we should use TypedRegion::getRValueRegion() or TypedRegion::getLValueRegion(). AuditCFNumberCreate check: - Now blasts through AnonTypedRegions that may layer the original memory region, thus checking if the actually memory block is of the appropriate type. This change was needed to work with the changes to StoreManager::CastRegion. GRExprEngine::VisitCast: - Conform to the new interface of StoreManager::CastRegion. Tests: - None of the analysis tests fail now for using the "basic store". - Disabled the tests 'array-struct.c' and 'rdar-6442306-1.m' pending further testing and bug fixing. llvm-svn: 60995
-
rdar://problem/6442306Ted Kremenek authored
GRExprEngine (VisitCast): - When using StoreManager::CastRegion, always use the state and value it returns to generate the next node. Failure to do so means that region values returned that don't require the state to be modified will get ignored. MemRegion: - Tighten the interface for ElementRegion. Now ElementRegion can only be created with a super region that is a 'TypedRegion' instead of any MemRegion. Code in BasicStoreManager/RegionStoreManager already assumed this, but it would result in a dynamic assertion check (and crash) rather than just having the compiler forbid the construction of such regions. - Added ElementRegion::getArrayRegion() to return the 'typed version' of an ElementRegion's super region. - Removed bogus assertion in ElementRegion::getType() that assumed that the super region was an AnonTypedRegion. All that matters is that it is a TypedRegion, which is now true all the time by design. BasicStore: - Modified getLValueElement() to check if the 'array' region is a TypedRegion before creating an ElementRegion. This conforms to the updated interface for ElementRegion. RegionStore: - In ArrayToPointer() gracefully handle things we don't reason about, and only create an ElementRegion if the array region is indeed a TypedRegion. llvm-svn: 60990
-
- Dec 11, 2008
-
-
Douglas Gregor authored
llvm-svn: 60897
-
Douglas Gregor authored
and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
-
Zhongxing Xu authored
llvm-svn: 60870
-
Zhongxing Xu authored
to them. llvm-svn: 60868
-
- Dec 10, 2008
-
-
Ted Kremenek authored
Fix to BasicStoreManager::getElementLValue: If the base region is a symbol, layer an AnonTypedRegion on top of it. llvm-svn: 60808
-
- Dec 09, 2008
-
-
Ted Kremenek authored
Have BasicStoreManager::getLValueElement() have logic similar to BasicStoreManager::getLValueField() (i.e., don't just return the 'base' as the SVal) llvm-svn: 60795
-
Ted Kremenek authored
In GRExprEngine treat @throw as an 'abort' that ends the current path. This is a temporary solution. llvm-svn: 60789
-
Zhongxing Xu authored
llvm-svn: 60758
-
Ted Kremenek authored
llvm-svn: 60734
-
Ted Kremenek authored
Fixed LiveVariables bug where we didn't consider block-level expressions that functioned as the size of a VLA to be live. llvm-svn: 60730
-
- Dec 08, 2008
-
-
Ted Kremenek authored
llvm-svn: 60726
-
Ted Kremenek authored
'self.myIvar = nil' (properties) only releases myIvar when the property has kind 'assign'. This fixes <rdar://problem/6380411>. llvm-svn: 60717
-
- Dec 06, 2008
-
-
Ted Kremenek authored
llvm-svn: 60622
-
- Dec 05, 2008
-
-
Ted Kremenek authored
Add SymbolRef::print() and have SymbolicRegion::print() use this method instead of calling SymbolRef::getNumber(). llvm-svn: 60578
-
Ted Kremenek authored
llvm-svn: 60577
-
Ted Kremenek authored
Rename SymbolID to SymbolRef. This is a precursor to some overhauling of the representation of symbolic values. llvm-svn: 60575
-
Ted Kremenek authored
llvm-svn: 60572
-
Ted Kremenek authored
StoreManager::Retrieve and StoreManager::RemoveDeadBindings now take a GRState* argument instead of a Store. This allows them to use the GDM for storing other data. llvm-svn: 60570
-
- Dec 04, 2008
-
-
Ted Kremenek authored
Revamp RegionStoreManager::RemoveDeadBindings. This method now does a complete mark-and-sweep of the store, removing dead regions and recording the set of live and dead symbols appropriately. llvm-svn: 60523
-
Ted Kremenek authored
llvm-svn: 60520
-
Zhongxing Xu authored
llvm-svn: 60516
-
- Dec 03, 2008
-
-
Ted Kremenek authored
- Fix nonsensical logic in AssumeSymGE. When comparing 'sym >= constant' and the constant is the maximum integer value, add the constraint that 'sym == constant' when the path is deemed feasible. All other cases are feasible. - Improve AssumeSymGT. When comparing 'sym > constant' and constant is the maximum integer value we know the path is infeasible. - Add test case for this enhancement to AssumeSymGT. llvm-svn: 60490
-
Ted Kremenek authored
- Fix nonsensical logic in AssumeSymLE. When comparing 'sym <= constant' and the constant is the minimum integer value, add the constraint that 'sym == constant' when the path is deemed feasible. All other cases are feasible. - Improve AssumeSymLT to address <rdar://problem/6407949>. When comparing 'sym < constant' and constant is the minimum integer value we know the path is infeasible. - Add test case for <rdar://problem/6407949>. llvm-svn: 60489
-
- Dec 02, 2008
-
-
Sebastian Redl authored
This may be the case on 64-bit systems. Whether that fact is a bug is a different question, but it's easy to cure the symptom. llvm-svn: 60422
-
Ted Kremenek authored
llvm-svn: 60390
-
- Nov 30, 2008
-
-
Zhongxing Xu authored
This fixes PR3127 http://llvm.org/bugs/show_bug.cgi?id=3127 llvm-svn: 60280
-
- Nov 29, 2008
-
-
Zhongxing Xu authored
llvm-svn: 60248
-
- Nov 28, 2008
-
-
Zhongxing Xu authored
When initialized, the index of the ElementRegion was unsigned. But the index value of the ArraySubscriptExpr is signed. This inconsistency caused the value of the array element retrieved to be UnknownVal despite it was initialized to symbolic. This is only a hack. Real fix of this problem is required. llvm-svn: 60207
-
Zhongxing Xu authored
llvm-svn: 60206
-
Zhongxing Xu authored
llvm-svn: 60205
-
- Nov 27, 2008
-
-
Zhongxing Xu authored
llvm-svn: 60151
-
Zhongxing Xu authored
GDMContext. llvm-svn: 60150
-
Zhongxing Xu authored
llvm-svn: 60146
-