From 5fc7def35ee858791e591d005b4ae343632ca931 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Thu, 8 Dec 2011 22:38:43 +0000 Subject: [analyzer] If memory region is tainted mark data as tainted. + random comments git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146199 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Core/ProgramState.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/StaticAnalyzer/Core/ProgramState.cpp') diff --git a/lib/StaticAnalyzer/Core/ProgramState.cpp b/lib/StaticAnalyzer/Core/ProgramState.cpp index 4ea2f4c9f2..807def26ff 100644 --- a/lib/StaticAnalyzer/Core/ProgramState.cpp +++ b/lib/StaticAnalyzer/Core/ProgramState.cpp @@ -709,6 +709,11 @@ bool ProgramState::isTainted(const SymExpr* Sym, TaintTagType Kind) const { // If this is a SymbolDerived with a tainted parent, it's also tainted. if (const SymbolDerived *SD = dyn_cast(*SI)) Tainted = Tainted || isTainted(SD->getParentSymbol(), Kind); + + // If memory region is tainted, data is also tainted. + if (const SymbolRegionValue *SRV = dyn_cast(*SI)) + Tainted = Tainted || isTainted(SRV->getRegion(), Kind); + if (Tainted) return true; } -- cgit v1.2.3