diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-11 02:29:48 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-11 02:29:48 +0000 |
commit | 7de20fe9aac00705dd943690563db66fa4b35b5b (patch) | |
tree | 63610c56f2603e7722290ae5fe408d17e8c0cf40 /lib/Analysis/SimpleConstraintManager.cpp | |
parent | 276c6aca0e9cd2bbd5533493612f67767544d839 (diff) |
SimpleConstraintManager doesn't reason about bitwise-constraints on symbolic
values. Indicating this in 'canReasonAbout' allows GRExprEngine to recover
path-sensitivity in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66628 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/SimpleConstraintManager.cpp')
-rw-r--r-- | lib/Analysis/SimpleConstraintManager.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Analysis/SimpleConstraintManager.cpp b/lib/Analysis/SimpleConstraintManager.cpp index 82cc0bb7bc..a4d59bec88 100644 --- a/lib/Analysis/SimpleConstraintManager.cpp +++ b/lib/Analysis/SimpleConstraintManager.cpp @@ -21,6 +21,19 @@ namespace clang { SimpleConstraintManager::~SimpleConstraintManager() {} bool SimpleConstraintManager::canReasonAbout(SVal X) const { + if (nonloc::SymIntConstraintVal *Y = dyn_cast<nonloc::SymIntConstraintVal>(&X)) { + const SymIntConstraint& C = Y->getConstraint(); + switch (C.getOpcode()) { + // We don't reason yet about bitwise-constraints on symbolic values. + case BinaryOperator::And: + case BinaryOperator::Or: + case BinaryOperator::Xor: + return false; + default: + return true; + } + } + return true; } |