diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-12-03 17:48:05 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-12-03 17:48:05 +0000 |
| commit | 4b349cc9c5cdcb872f7fdc56366ea7f293a43da1 (patch) | |
| tree | 8510db8d32ff646e76c37a1ac8217877a3006f11 /clang/lib/Analysis | |
| parent | ce2cd016470c5cf6c9bf460f0beae02c633b6328 (diff) | |
| download | bcm5719-llvm-4b349cc9c5cdcb872f7fdc56366ea7f293a43da1.tar.gz bcm5719-llvm-4b349cc9c5cdcb872f7fdc56366ea7f293a43da1.zip | |
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.
llvm-svn: 90462
Diffstat (limited to 'clang/lib/Analysis')
| -rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 6c452c23dcc..a9cd582bf8b 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/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; |

