diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-06-01 20:04:04 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-06-01 20:04:04 +0000 |
commit | 7fa9b4f258636d89342eda28f21a986c8ac353b1 (patch) | |
tree | d7b3c4df21fc87a3f8eb202703db8f322d73aa5d /lib/StaticAnalyzer/Core/ProgramState.cpp | |
parent | 784ae8e5c6b557e2395991c6008293660f5afe66 (diff) |
static analyzer: add inlining support for directly called blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157833 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ProgramState.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ProgramState.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/ProgramState.cpp b/lib/StaticAnalyzer/Core/ProgramState.cpp index b9cfa27808..a666de0c5c 100644 --- a/lib/StaticAnalyzer/Core/ProgramState.cpp +++ b/lib/StaticAnalyzer/Core/ProgramState.cpp @@ -568,6 +568,16 @@ bool ScanReachableSymbols::scan(const MemRegion *R) { if (!scan(SR->getSuperRegion())) return false; + // Regions captured by a block are also implicitly reachable. + if (const BlockDataRegion *BDR = dyn_cast<BlockDataRegion>(R)) { + BlockDataRegion::referenced_vars_iterator I = BDR->referenced_vars_begin(), + E = BDR->referenced_vars_end(); + for ( ; I != E; ++I) { + if (!scan(I.getCapturedRegion())) + return false; + } + } + // Now look at the binding to this region (if any). if (!scan(state->getSValAsScalarOrLoc(R))) return false; |