aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-03 17:48:05 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-03 17:48:05 +0000
commita7a8dfd702274fd19ef8b237682b75d814ecfc91 (patch)
tree237f4c70c2f224385ba3459e4b5bdac2f95f13a1 /lib/Analysis/RegionStore.cpp
parent7b0ca3fa6f9e89d81db96fe51d4d73bf69d17edc (diff)
Tweak handling of BlockDataRegions in RegionStoreManager::RemoveDeadBindings(): only the VarRegions for variables marked with the '__block' annotation should have their lifetime extended by a BlockDataRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 6c452c23dc..a9cd582bf8 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -1776,14 +1776,16 @@ tryAgain:
if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(R))
SymReaper.markLive(SymR->getSymbol());
- // For BlockDataRegions, enqueue all VarRegions for that are referenced
+ // For BlockDataRegions, enqueue the VarRegions for variables marked
+ // with __block (passed-by-reference).
// via BlockDeclRefExprs.
if (const BlockDataRegion *BD = dyn_cast<BlockDataRegion>(R)) {
for (BlockDataRegion::referenced_vars_iterator
RI = BD->referenced_vars_begin(), RE = BD->referenced_vars_end();
- RI != RE; ++RI)
- WorkList.push_back(std::make_pair(state_N, *RI));
-
+ RI != RE; ++RI) {
+ if ((*RI)->getDecl()->getAttr<BlocksAttr>())
+ WorkList.push_back(std::make_pair(state_N, *RI));
+ }
// No possible data bindings on a BlockDataRegion. Continue to the
// next region in the worklist.
continue;