]> granicus.if.org Git - clang/commit
More test cases revealed that the logic in StoreManager::InvalidateRegion() needs...
authorTed Kremenek <kremenek@apple.com>
Wed, 15 Jul 2009 02:31:43 +0000 (02:31 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 15 Jul 2009 02:31:43 +0000 (02:31 +0000)
commita6275a534da701f37d19a068e6361e5f10f983a1
tree93a060553f74507c52ba489ab9b0b2733b1704a7
parentfb91c70e24e20f8704edf9bc5049ffbe7e234a38
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75730 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Analysis/PathSensitive/MemRegion.h
lib/Analysis/RegionStore.cpp
lib/Analysis/Store.cpp
test/Analysis/misc-ps-region-store-i386.m
test/Analysis/misc-ps-region-store-x86_64.m
test/Analysis/misc-ps-region-store.m