[cfe-commits] r144928 - /cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp

Anna Zaks ganna at apple.com
Thu Nov 17 14:59:00 PST 2011


Author: zaks
Date: Thu Nov 17 16:59:00 2011
New Revision: 144928

URL: http://llvm.org/viewvc/llvm-project?rev=144928&view=rev
Log:
[analyzer] Minor tweaks to the ProgramState::isTainted().

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp?rev=144928&r1=144927&r2=144928&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ProgramState.cpp Thu Nov 17 16:59:00 2011
@@ -644,15 +644,13 @@
 }
 
 bool ProgramState::isTainted(SVal V, TaintTagType Kind) const {
-  const SymExpr* Sym = V.getAsSymbol();
-  if (!Sym)
-    Sym = V.getAsSymbolicExpression();
-  if (!Sym)
-    return false;
-  return isTainted(Sym, Kind);
+  return isTainted(V.getAsSymExpr(), Kind);
 }
 
 bool ProgramState::isTainted(const SymExpr* Sym, TaintTagType Kind) const {
+  if (!Sym)
+    return false;
+
   // Check taint on derived symbols.
   if (const SymbolDerived *SD = dyn_cast<SymbolDerived>(Sym))
     return isTainted(SD->getParentSymbol(), Kind);





More information about the cfe-commits mailing list