diff options
author | Anna Zaks <ganna@apple.com> | 2011-12-10 23:36:51 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-12-10 23:36:51 +0000 |
commit | 24d052cdb75d3c1afa5bef32eacaa224e9d0b85d (patch) | |
tree | e27747c97305835135103193ef28ca989bbe933a /lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | |
parent | 6fcd932dfd6835f70cc00d6f7c6789793f6d7b66 (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp index a7b67fbe8a..70901aa608 100644 --- a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp @@ -388,9 +388,9 @@ SVal SimpleSValBuilder::evalBinOpNN(const ProgramState *state, if (lhsValue == 0) // At this point lhs and rhs have been swapped. return rhs; - return generateUnknownVal(state, op, lhs, rhs, resultTy); + return generateUnknownVal(state, op, rhs, lhs, resultTy); default: - return generateUnknownVal(state, op, lhs, rhs, resultTy); + return generateUnknownVal(state, op, rhs, lhs, resultTy); } } } |