diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-16 22:21:33 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-16 22:21:33 +0000 |
commit | 4b441f057688cf0d3e6d74ac530ce3eb2d965c5e (patch) | |
tree | 63080b07d354b1fdf80a569bc0665e0f0134b6da | |
parent | 2140e904dbe53657339cb5b1cc13de563ca0d1fc (diff) |
Modify getMaxValue/getMinValue to take pointer values as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64682 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Analysis/PathSensitive/BasicValueFactory.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/clang/Analysis/PathSensitive/BasicValueFactory.h b/include/clang/Analysis/PathSensitive/BasicValueFactory.h index a494962789..f25bf5da1d 100644 --- a/include/clang/Analysis/PathSensitive/BasicValueFactory.h +++ b/include/clang/Analysis/PathSensitive/BasicValueFactory.h @@ -90,15 +90,15 @@ public: } inline const llvm::APSInt& getMaxValue(QualType T) { - assert(T->isIntegerType()); - return getValue(llvm::APSInt::getMaxValue(Ctx.getTypeSize(T), - T->isUnsignedIntegerType())); + assert(T->isIntegerType() || T->isPointerType()); + bool isUnsigned = T->isUnsignedIntegerType() || T->isPointerType(); + return getValue(llvm::APSInt::getMaxValue(Ctx.getTypeSize(T), isUnsigned)); } inline const llvm::APSInt& getMinValue(QualType T) { - assert(T->isIntegerType()); - return getValue(llvm::APSInt::getMinValue(Ctx.getTypeSize(T), - T->isUnsignedIntegerType())); + assert(T->isIntegerType() || T->isPointerType()); + bool isUnsigned = T->isUnsignedIntegerType() || T->isPointerType(); + return getValue(llvm::APSInt::getMinValue(Ctx.getTypeSize(T), isUnsigned)); } inline const llvm::APSInt& Add1(const llvm::APSInt& V) { |