[analyzer] Minor tweaks to the ProgramState::isTainted().

llvm-svn: 144928
This commit is contained in:
Anna Zaks 2011-11-17 22:59:00 +00:00
parent af36e9128a
commit 89c00c9d3f
1 changed files with 4 additions and 6 deletions

View File

@ -644,15 +644,13 @@ bool ProgramState::isTainted(const Stmt *S, TaintTagType Kind) const {
}
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);