diff options
author | Jordy Rose <jediknil@belkadan.com> | 2012-03-15 22:45:29 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2012-03-15 22:45:29 +0000 |
commit | 735724fb1e786f7c37363a965090557670b33650 (patch) | |
tree | 1618d5b1cd9a83bd044b3d6e6b8aba1c965644a5 /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
parent | 3b71b17753f0b2360e7c4b4c31643f23fdb25f8d (diff) | |
download | bcm5719-llvm-735724fb1e786f7c37363a965090557670b33650.tar.gz bcm5719-llvm-735724fb1e786f7c37363a965090557670b33650.zip |
[analyzer] If a metadata symbol is interesting, its region is interesting as well.
llvm-svn: 152868
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 0a0c1fdb51c..b59405bcd2e 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1255,6 +1255,9 @@ void BugReport::markInteresting(SymbolRef sym) { if (!sym) return; interestingSymbols.insert(sym); + + if (const SymbolMetadata *meta = dyn_cast<SymbolMetadata>(sym)) + interestingRegions.insert(meta->getRegion()); } void BugReport::markInteresting(const MemRegion *R) { @@ -1262,7 +1265,7 @@ void BugReport::markInteresting(const MemRegion *R) { return; R = R->getBaseRegion(); interestingRegions.insert(R); - + if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(R)) interestingSymbols.insert(SR->getSymbol()); } @@ -1279,6 +1282,8 @@ bool BugReport::isInteresting(SVal V) const { bool BugReport::isInteresting(SymbolRef sym) const { if (!sym) return false; + // We don't currently consider metadata symbols to be interesting + // even if we know their region is interesting. Is that correct behavior? return interestingSymbols.count(sym); } |