Commit Graph

18 Commits

Author SHA1 Message Date
Ted Kremenek 267e45adab Fix: <rdar://problem/7249340> [RegionStore] model stores to symbolic parameter regions
The issue was a discrepancy between how RegionStoreManager::Bind() and
RegionStoreManager::Retrieve() derived the "key" for the first element
of a symbolic region.

llvm-svn: 82680
2009-09-24 04:11:44 +00:00
Ted Kremenek 3003001a86 Fix: <rdar://problem/7242006> [RegionStore] compound literal assignment with floats not honored
llvm-svn: 82575
2009-09-22 21:19:14 +00:00
Ted Kremenek 25c9c1427a Provide intermediate solution to handling assignments to structs via an
integer pointer.  For now just invalidate the fields of the struct.

This addresses: <rdar://problem/7185607> [RegionStore] support invalidation of bit fields using integer assignment

llvm-svn: 82492
2009-09-21 22:58:52 +00:00
Ted Kremenek 2f6eb14af4 Fix a couple false positive "uninitialized value" warnings with RegionStore
involving reasoning about unions (which we don't handle yet).

llvm-svn: 78342
2009-08-06 21:43:54 +00:00
Zhongxing Xu 13ee441874 Add test case.
llvm-svn: 78150
2009-08-05 03:45:09 +00:00
Ted Kremenek d7e467f39c Add test case testing field sensitivity. Reduced from <rdar://problem/7114618>.
llvm-svn: 78008
2009-08-03 22:23:24 +00:00
Ted Kremenek 6ab0a74a25 Add test case for bug fix in r76262.
llvm-svn: 76283
2009-07-18 05:02:33 +00:00
Ted Kremenek e6fea68c46 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
2009-07-15 02:31:43 +00:00
Ted Kremenek 9a797db199 Split out 'test2' into an i386 and x86_64 file, illustrating how the
test behavior differs between architectures.  When this is no longer
the case, these tests will be merged.

llvm-svn: 75708
2009-07-14 23:17:22 +00:00
Ted Kremenek eea582f04f This test currently only passes for 32-bit archs.
llvm-svn: 75698
2009-07-14 22:58:18 +00:00
Ted Kremenek 0c37d19fea 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
2009-07-14 20:48:22 +00:00
Ted Kremenek b63f71528e Enhance SimpleSValuator::EvalBinOpNN to recognize the trivial case
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
2009-07-13 21:55:12 +00:00
Daniel Dunbar a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Ted Kremenek fa3d77bc2c Retrofit some basic tracking of ivars (for the current object) into BasicStore.
llvm-svn: 66166
2009-03-05 18:08:28 +00:00
Ted Kremenek 77a3cb2dfa Add test case for RegionStore's tracking of the ivars of 'self'.
llvm-svn: 66136
2009-03-05 04:55:08 +00:00
Ted Kremenek 33129a26f7 Add prototype support for invalidating fields for structures passed-by-reference
to unknown functions. Most of this logic should be eventually moved to
RegionStore and be made lazy.

llvm-svn: 66094
2009-03-04 22:56:43 +00:00
Ted Kremenek b535181199 Static Analyzer driver/options (partial) cleanup:
- Move all analyzer options logic to AnalysisConsumer.cpp.
- Unified specification of stores/constraints/output to be:
   -analyzer-output=...
   -analyzer-store=...
   -analyzer-constraints=...
  instead of -analyzer-range-constraints, -analyzer-store-basic, etc.
- Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new
  interface
- Updated test cases to conform to new driver options

llvm-svn: 64737
2009-02-17 04:27:41 +00:00
Ted Kremenek 556c3709d6 The 'misc-ps.m' test case now passes with RegionStore. One case needed to be split out into 'misc-ps-basic-store.m' and 'misc-ps-region-store.m' because the behavior was different between the two store models (RegionStore flags an additional valid bug).
llvm-svn: 62772
2009-01-22 18:53:15 +00:00