summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/SimpleConstraintManager.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-23 17:10:25 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-23 17:10:25 +0000
commitb294d196b309c7a39ecded3d5eae99ac1340b2b2 (patch)
tree2c7005e5b94b82b26cab436f972ad5a7c5d1d0fd /clang/lib/Analysis/SimpleConstraintManager.cpp
parentd6b05f705b2888137615d619e9a5a4d3ce8f2f11 (diff)
downloadbcm5719-llvm-b294d196b309c7a39ecded3d5eae99ac1340b2b2.tar.gz
bcm5719-llvm-b294d196b309c7a39ecded3d5eae99ac1340b2b2.zip
analyzer: Provide temporary workaround for false positive reported by
<rdar://problem/6704930> involving SimpleConstraintManager not reasoning well about symbolic constraint values involving arithmetic operators. llvm-svn: 67534
Diffstat (limited to 'clang/lib/Analysis/SimpleConstraintManager.cpp')
-rw-r--r--clang/lib/Analysis/SimpleConstraintManager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Analysis/SimpleConstraintManager.cpp b/clang/lib/Analysis/SimpleConstraintManager.cpp
index a4d59bec887..e6f940e57cc 100644
--- a/clang/lib/Analysis/SimpleConstraintManager.cpp
+++ b/clang/lib/Analysis/SimpleConstraintManager.cpp
@@ -29,6 +29,17 @@ bool SimpleConstraintManager::canReasonAbout(SVal X) const {
case BinaryOperator::Or:
case BinaryOperator::Xor:
return false;
+ // We don't reason yet about arithmetic constraints on symbolic values.
+ case BinaryOperator::Mul:
+ case BinaryOperator::Div:
+ case BinaryOperator::Rem:
+ case BinaryOperator::Add:
+ case BinaryOperator::Sub:
+ case BinaryOperator::Shl:
+ case BinaryOperator::Shr:
+ return false;
+
+ // All other cases.
default:
return true;
}
OpenPOWER on IntegriCloud