diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-08-25 20:51:30 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-08-25 20:51:30 +0000 |
commit | 3ed9543ace0547681d018a4cbbe9c62fc0524e17 (patch) | |
tree | 8b2c03c60274f5397b68e258d317e4c2480e6e39 /clang/lib/Analysis/Store.cpp | |
parent | 6d9d5a9c9477cba8825e571c3c86c77bfc2ea8d6 (diff) | |
download | bcm5719-llvm-3ed9543ace0547681d018a4cbbe9c62fc0524e17.tar.gz bcm5719-llvm-3ed9543ace0547681d018a4cbbe9c62fc0524e17.zip |
Fix crash reported in <rdar://problem/7124210> by "back-porting" some of the
implicit cast logic in RegionStoreManager to BasicStoreManager. This involved
moving CastRetriedVal from RegionStoreManager to StoreManager.
llvm-svn: 80026
Diffstat (limited to 'clang/lib/Analysis/Store.cpp')
-rw-r--r-- | clang/lib/Analysis/Store.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/Analysis/Store.cpp b/clang/lib/Analysis/Store.cpp index fca69e69cb3..e2412f6e280 100644 --- a/clang/lib/Analysis/Store.cpp +++ b/clang/lib/Analysis/Store.cpp @@ -197,3 +197,19 @@ StoreManager::CastRegion(const GRState *state, const MemRegion* R, return CastResult(state, R); } + + +/// CastRetrievedVal - Used by subclasses of StoreManager to implement +/// implicit casts that arise from loads from regions that are reinterpreted +/// as another region. +SValuator::CastResult StoreManager::CastRetrievedVal(SVal V, + const GRState *state, + const TypedRegion *R, + QualType castTy) { + if (castTy.isNull()) + return SValuator::CastResult(state, V); + + ASTContext &Ctx = ValMgr.getContext(); + return ValMgr.getSValuator().EvalCast(V, state, castTy, R->getValueType(Ctx)); +} + |