diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-05-11 22:55:17 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-05-11 22:55:17 +0000 |
commit | 97f75f8bda68999d91c637da62cc83260cfb7a4d (patch) | |
tree | e3a2d02809d2d977ffd39efbbea1ca0232b9a67d /clang/lib/Analysis/CFRefCount.cpp | |
parent | e3c3f404043b58adfd35b113ded3c51ffb6c5baf (diff) | |
download | bcm5719-llvm-97f75f8bda68999d91c637da62cc83260cfb7a4d.tar.gz bcm5719-llvm-97f75f8bda68999d91c637da62cc83260cfb7a4d.zip |
When stripping element regions for invalidating region values, treat FieldRegions and ObjCIvarRegions as "base" regions in addition to VarRegions.
llvm-svn: 71488
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | clang/lib/Analysis/CFRefCount.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 29a28c1a199..bc140077dc7 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -2673,10 +2673,13 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst, // approriately delegated to the respective StoreManagers while // still allowing us to do checker-specific logic (e.g., // invalidating reference counts), probably via callbacks. - if (ER->getElementType()->isIntegralType()) - if (const VarRegion *superReg = - dyn_cast<VarRegion>(ER->getSuperRegion())) - R = superReg; + if (ER->getElementType()->isIntegralType()) { + const MemRegion *superReg = ER->getSuperRegion(); + if (isa<VarRegion>(superReg) || isa<FieldRegion>(superReg) || + isa<ObjCIvarRegion>(superReg)) + R = cast<TypedRegion>(superReg); + } + // FIXME: What about layers of ElementRegions? } |