From 3f5a85ad062e341ecf9a9ed459406e76390c032c Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 11 Mar 2009 02:29:48 +0000 Subject: SimpleConstraintManager doesn't reason about bitwise-constraints on symbolic values. Indicating this in 'canReasonAbout' allows GRExprEngine to recover path-sensitivity in some cases. llvm-svn: 66628 --- clang/lib/Analysis/SimpleConstraintManager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'clang/lib/Analysis/SimpleConstraintManager.cpp') diff --git a/clang/lib/Analysis/SimpleConstraintManager.cpp b/clang/lib/Analysis/SimpleConstraintManager.cpp index 82cc0bb7bc2..a4d59bec887 100644 --- a/clang/lib/Analysis/SimpleConstraintManager.cpp +++ b/clang/lib/Analysis/SimpleConstraintManager.cpp @@ -21,6 +21,19 @@ namespace clang { SimpleConstraintManager::~SimpleConstraintManager() {} bool SimpleConstraintManager::canReasonAbout(SVal X) const { + if (nonloc::SymIntConstraintVal *Y = dyn_cast(&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; } -- cgit v1.2.3