- Jul 16, 2009
-
-
Ted Kremenek authored
(1) Moved the SValuator object from GRExprEngine to ValueManager. This allows ValueManager to use the SValuator when creating SVals. (2) Added ValueManager::makeArrayIndex() and ValueManager::convertToArrayIndex(), two SVal creation methods that will help RegionStoreManager always have a consistent set of SVals with the same integer size and type when reasoning about array indices. llvm-svn: 75882
-
Zhongxing Xu authored
llvm-svn: 75873
-
Ted Kremenek authored
llvm-svn: 75865
-
rdar://problem/7062158Ted Kremenek authored
Fix <rdar://problem/7062158> by having BasicStoreManager model values for 'static' global variables. llvm-svn: 75844
-
- Jul 15, 2009
-
-
Ted Kremenek authored
llvm-svn: 75832
-
Zhongxing Xu authored
llvm-svn: 75761
-
Zhongxing Xu authored
llvm-svn: 75750
-
Ted Kremenek authored
llvm-svn: 75748
-
Zhongxing Xu authored
llvm-svn: 75745
-
Ted Kremenek authored
llvm-svn: 75738
-
Ted Kremenek authored
More test cases revealed that the logic in StoreManager::InvalidateRegion() needs more finesse when handling the invalidation of pointers. Pointers that were invalidated as integers could later cause problems for clients using them as pointers. It is easier for us to model a symbolic value as a pointer rather than modeling a non-symbolic value as a pointer. This patch causes: - StoreManager::InvalidateRegion() to not used the casted type of a region if it would cause a pointer type to be invalidated as a non-pointer type. - Pushes RegionStore::RetrieveElement() further by handling retrievals from symbolic arrays that have been invalidated. This uses the new SymbolDerived construct that was recently introduced. The result is that the failing test in misc-ps-region-store-x86_64.m now passes. Both misc-ps-region-store-x86_64.m and misc-ps-region-store-i386.m contain a test case that motivated this change. llvm-svn: 75730
-
Ted Kremenek authored
SymbolDerived allows us to model symbolic values that are related to other symbols via a region hierarchy. For example, SymbolDerived can be used to model individual values of a symbolic array. llvm-svn: 75728
-
Ted Kremenek authored
llvm-svn: 75713
-
- Jul 14, 2009
-
-
Ted Kremenek authored
Enhance RegionStoreManager to handle 'Retrieve's from SymbolicRegions. We do this by silently wrapping the region with an ElementRegion. This fixes the failures in misc-ps-region-store.m. llvm-svn: 75679
-
Ted Kremenek authored
llvm-svn: 75672
-
Steve Naroff authored
I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace. llvm-svn: 75650
-
Zhongxing Xu authored
invalidate the region correctly. It uses the cast-to type to invalidate the region when available. To avoid invalid cast-to type like 'void*' or 'id', region store now only records non-generic casts of regions. llvm-svn: 75580
-
Ted Kremenek authored
are not explicitly marked as not accepting NULL pointers. This check illustrates how we need more refactoring in the custom-check logic. llvm-svn: 75570
-
Ted Kremenek authored
Tidy pretty-printing for SVals, using 'dump()' instead of 'printStdErr()', and implementing operator<< support for llvm::raw_ostream. llvm-svn: 75560
-
Ted Kremenek authored
When pretty-printing symbolic regions, use '{' ... '}' to indicate the symbol used for the region (makes it easier to read for nested regions). llvm-svn: 75550
-
Ted Kremenek authored
Change pretty-printing API for SymExprs and MemRegions to use a naming convention and style similar to other elements in Clang. llvm-svn: 75548
-
- Jul 13, 2009
-
-
Ted Kremenek authored
where we are comparing a symbolic value against itself, regardless of the nature of that symbolic value. This enhancement identified a case where RegionStoreManager is not correctly symbolicating the values of the pointees of parameters. The failing test is now in 'test/Analysis/misc-ps-region-store.m', with that test file now (temporarily) marked XFAIL. llvm-svn: 75521
-
- Jul 11, 2009
-
-
Ted Kremenek authored
Handle insidious corner case exposed by RegionStoreManager when handling void* values that are bound to symbolic regions and then treated like integers. llvm-svn: 75356
-
Ted Kremenek authored
MemRegion kinds. This allows the compiler to identify what MemRegions we don't handle for pointer arithmetic. llvm-svn: 75326
-
Steve Naroff authored
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches. This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic. By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks. llvm-svn: 75314
-
Ted Kremenek authored
over the types of MemRegions. This allows the compiler to warn us which regions are not handled, and also is a little faster. llvm-svn: 75304
-
- Jul 10, 2009
-
-
Ted Kremenek authored
CodeTextRegions can only be casted to FunctionPointer or BlockPointerTypes. This simply isn't true. We can handle bogus operations on CodeTextRegions (e.g, an array access) elsewhere. llvm-svn: 75285
-
Ted Kremenek authored
void**, void***, etc. Such casts should just pass the region through. llvm-svn: 75281
-
Ted Kremenek authored
Rename potentially ambiguous member template 'getRegion' to 'getSubRegion' to hopefully resolve template lookup ambiguities on some compilers. llvm-svn: 75253
-
Ted Kremenek authored
and replace the 'clang-cc' option '-analyzer-store=basic-new-cast' with '-analyzer-store=basic-old-cast'. We'll keep the old CastRegion implementation around for a little while for regression testing. llvm-svn: 75209
-
- Jul 09, 2009
-
-
Zhongxing Xu authored
llvm-svn: 75127
-
- Jul 07, 2009
-
-
Zhongxing Xu authored
llvm-svn: 74890
-
Ted Kremenek authored
llvm-svn: 74884
-
Ted Kremenek authored
llvm-svn: 74877
-
Ted Kremenek authored
region type. This better shows the logic of the method and allows the compiler to check if we didn't handle a specific region kind. llvm-svn: 74876
-
Ted Kremenek authored
llvm-svn: 74875
-
Ted Kremenek authored
llvm-svn: 74874
-
Ted Kremenek authored
llvm-svn: 74872
-
Ted Kremenek authored
- Refactor logic that creates ElementRegions into a help method 'MakeElementRegion'. - Fix crash due to not handling StringRegions. Casts of StringRegions now result in a new ElementRegion layered on the original StringRegion. llvm-svn: 74867
-
- Jul 06, 2009
-
-
Ted Kremenek authored
Make 'BasicStoreManager' + 'NewCastRegion' testable from the command line using '-analyzer-store=basic-new-cast'. llvm-svn: 74865
-