diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-01-11 02:33:26 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-01-11 02:33:26 +0000 |
commit | c50e6df965ff264952d8d5805d151f89c89af302 (patch) | |
tree | 152617f90a6c67ffd9d68f7d8adb4c72d5c9ddf8 /include/clang/Analysis/PathSensitive | |
parent | 1c1ae6bdaf89145648484db5dfebcd04a60595c9 (diff) |
Switch RegionStore over to using <BaseRegion+raw offset> to store
value bindings. Along with a small change to OSAtomicChecker, this
resolves <rdar://problem/7527292> and resolves some long-standing
issues with how values can be bound to the same physical address by
not have the same "key". This change is only a beginning; logically
RegionStore needs to better handle loads from addresses where the
stored value is larger/smaller/different type than the loaded value.
We handle these cases in an approximate fashion now (via
CastRetrievedVal and help in SimpleSValuator), but it could be made
much smarter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive')
-rw-r--r-- | include/clang/Analysis/PathSensitive/SValuator.h | 4 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/Store.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/include/clang/Analysis/PathSensitive/SValuator.h b/include/clang/Analysis/PathSensitive/SValuator.h index e63eb12cf8..4a4b502c62 100644 --- a/include/clang/Analysis/PathSensitive/SValuator.h +++ b/include/clang/Analysis/PathSensitive/SValuator.h @@ -28,8 +28,10 @@ class SValuator { protected: ValueManager &ValMgr; +public: + // FIXME: Make these protected again one RegionStoreManager correctly + // handles loads from differening bound value types. virtual SVal EvalCastNL(NonLoc val, QualType castTy) = 0; - virtual SVal EvalCastL(Loc val, QualType castTy) = 0; public: diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h index aaf8223b66..70c17accb7 100644 --- a/include/clang/Analysis/PathSensitive/Store.h +++ b/include/clang/Analysis/PathSensitive/Store.h @@ -189,7 +189,8 @@ protected: /// CastRetrievedVal - Used by subclasses of StoreManager to implement /// implicit casts that arise from loads from regions that are reinterpreted /// as another region. - SVal CastRetrievedVal(SVal val, const TypedRegion *R, QualType castTy); + SVal CastRetrievedVal(SVal val, const TypedRegion *R, QualType castTy, + bool performTestOnly = true); }; // FIXME: Do we still need this? |