summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-12-10 23:36:51 +0000
committerAnna Zaks <ganna@apple.com>2011-12-10 23:36:51 +0000
commitecd730085d4e19709d76a10300a15bc9fd4fb562 (patch)
treeecf32a857ee0263a6c32be93e5c39cd9d809b337 /clang/lib/StaticAnalyzer/Core/ProgramState.cpp
parenta461c1c06956f2fd9f988cadc777f78f4be84e78 (diff)
downloadbcm5719-llvm-ecd730085d4e19709d76a10300a15bc9fd4fb562.tar.gz
bcm5719-llvm-ecd730085d4e19709d76a10300a15bc9fd4fb562.zip
[analyzer] Introduce IntSymExpr, where the integer is on the lhs.
Fix a bug in SimpleSValBuilder, where we should swap lhs and rhs when calling generateUnknownVal(), - the function which creates symbolic expressions when data is tainted. The issue is not visible when we only create the expressions for taint since all expressions are commutative from taint perspective. Refactor SymExpr::symbol_iterator::expand() to use a switch instead of a chain of ifs. llvm-svn: 146336
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ProgramState.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ProgramState.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
index 807def26ff2..43b0b3e9423 100644
--- a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
@@ -565,6 +565,8 @@ bool ScanReachableSymbols::scan(const SymExpr *sym) {
return scan(cast<SymbolCast>(sym)->getOperand());
case SymExpr::SymIntKind:
return scan(cast<SymIntExpr>(sym)->getLHS());
+ case SymExpr::IntSymKind:
+ return scan(cast<IntSymExpr>(sym)->getRHS());
case SymExpr::SymSymKind: {
const SymSymExpr *x = cast<SymSymExpr>(sym);
return scan(x->getLHS()) && scan(x->getRHS());
OpenPOWER on IntegriCloud