summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-12-15 21:27:06 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-12-15 21:27:06 +0000
commit64c01f7bef8d65716f12e7556238ea8f8c2c010e (patch)
tree41fb79676ba342a7cfb2638af738338f2b0d25ec /clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
parent6698c15cb64c5a6b27521466ab8565a906b2323f (diff)
downloadbcm5719-llvm-64c01f7bef8d65716f12e7556238ea8f8c2c010e.tar.gz
bcm5719-llvm-64c01f7bef8d65716f12e7556238ea8f8c2c010e.zip
[analyzer] Add a new SVal to support pointer-to-member operations.
Add a new type of NonLoc SVal for C++ pointer-to-member operations. This SVal supports both pointers to member functions and pointers to member data. A patch by Kirill Romanenkov! Differential Revision: https://reviews.llvm.org/D25475 llvm-svn: 289873
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp b/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
index 7d0575dc6f3..c5e0f9b8626 100644
--- a/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
@@ -182,6 +182,12 @@ ProgramStateRef SimpleConstraintManager::assumeAux(ProgramStateRef State,
return isFeasible ? State : nullptr;
}
+ case nonloc::PointerToMemberKind: {
+ bool IsNull = !Cond.castAs<nonloc::PointerToMember>().isNullMemberPointer();
+ bool IsFeasible = IsNull ? Assumption : !Assumption;
+ return IsFeasible ? State : nullptr;
+ }
+
case nonloc::LocAsIntegerKind:
return assume(State, Cond.castAs<nonloc::LocAsInteger>().getLoc(),
Assumption);
OpenPOWER on IntegriCloud