aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/Store.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-08-28 04:49:15 +0000
committerTed Kremenek <kremenek@apple.com>2009-08-28 04:49:15 +0000
commitabd46e13cfd48f2c9bf26d9759edb4366aaa6d5b (patch)
tree0fc9e1bd9f3fae64398a5da5b68c3cead87ba1de /lib/Analysis/Store.cpp
parent73b39cf02eaa346c6d7a76c32bf13759de7516db (diff)
Use SymbolicRegion instead of CodeTextRegion for symbolic function
pointers. Most logic cares first about whether or not a region is symbolic, and second if represents code. This should fix a series of silent corner case bugs (as well as simplify a bunch of code). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80335 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/Store.cpp')
-rw-r--r--lib/Analysis/Store.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Analysis/Store.cpp b/lib/Analysis/Store.cpp
index e2412f6e28..f0ecda73de 100644
--- a/lib/Analysis/Store.cpp
+++ b/lib/Analysis/Store.cpp
@@ -52,16 +52,12 @@ StoreManager::CastRegion(const GRState *state, const MemRegion* R,
return CastResult(state, R->getBaseRegion());
if (CastToTy->isBlockPointerType()) {
- if (isa<CodeTextRegion>(R))
- return CastResult(state, R);
-
- // FIXME: This may not be the right approach, depending on the symbol
+ // FIXME: We may need different solutions, depending on the symbol
// involved. Blocks can be casted to/from 'id', as they can be treated
- // as Objective-C objects.
- if (SymbolRef sym = loc::MemRegionVal(R).getAsSymbol()) {
- R = MRMgr.getCodeTextRegion(sym, CastToTy);
+ // as Objective-C objects. This could possibly be handled by enhancing
+ // our reasoning of downcasts of symbolic objects.
+ if (isa<CodeTextRegion>(R) || isa<SymbolicRegion>(R))
return CastResult(state, R);
- }
// We don't know what to make of it. Return a NULL region, which
// will be interpretted as UnknownVal.