aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-01-13 00:56:51 +0000
committerAnna Zaks <ganna@apple.com>2012-01-13 00:56:51 +0000
commit71d29095d27e94b00083259c06a45f5294501697 (patch)
tree525053744046535ca8c4e9771b61ce401cd82701 /lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
parentce8ef16b1c58a304b7b59fad9836ad32d6ed020c (diff)
[analyzer] Taint: when looking up a binding, provide the type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp b/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
index 81f16bdfa8..1d112c5328 100644
--- a/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
@@ -243,7 +243,10 @@ SymbolRef GenericTaintChecker::getPointedToSymbol(CheckerContext &C,
return 0;
}
- SVal Val = State->getSVal(*AddrLoc);
+ const PointerType *ArgTy =
+ dyn_cast<PointerType>(Arg->getType().getCanonicalType().getTypePtr());
+ assert(ArgTy);
+ SVal Val = State->getSVal(*AddrLoc, ArgTy->getPointeeType());
return Val.getAsSymbol();
}