]> granicus.if.org Git - clang/commitdiff
[analyzer] If a metadata symbol is interesting, its region is interesting as well.
authorJordy Rose <jediknil@belkadan.com>
Thu, 15 Mar 2012 22:45:29 +0000 (22:45 +0000)
committerJordy Rose <jediknil@belkadan.com>
Thu, 15 Mar 2012 22:45:29 +0000 (22:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152868 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporter.cpp

index 0a0c1fdb51ce362542e7e25223ddc10ae097ab95..b59405bcd2ec63d8e658fac11896ff5b381a1f2b 100644 (file)
@@ -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);
 }