diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-11-09 06:52:44 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-11-09 06:52:44 +0000 |
commit | b10a7c235f82c6eb074be097c9ae7ee51fccc9c6 (patch) | |
tree | e25db2b068a59de0cce4bd231156adb8d0d48204 /lib/Analysis/SVals.cpp | |
parent | 3ce2dc358ea951c384fa27bcf2ba4a222c2c0511 (diff) |
Add checker for CWE-587: Assignment of a Fixed Address to a Pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/SVals.cpp')
-rw-r--r-- | lib/Analysis/SVals.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/SVals.cpp b/lib/Analysis/SVals.cpp index 688b7ff6e1..e230d274c5 100644 --- a/lib/Analysis/SVals.cpp +++ b/lib/Analysis/SVals.cpp @@ -173,6 +173,10 @@ nonloc::CompoundVal::iterator nonloc::CompoundVal::end() const { // Useful predicates. //===----------------------------------------------------------------------===// +bool SVal::isConstant() const { + return isa<nonloc::ConcreteInt>(this) || isa<loc::ConcreteInt>(this); +} + bool SVal::isZeroConstant() const { if (isa<loc::ConcreteInt>(*this)) return cast<loc::ConcreteInt>(*this).getValue() == 0; |