summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h b/clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h
index a4949627897..f25bf5da1d3 100644
--- a/clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h
+++ b/clang/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) {
OpenPOWER on IntegriCloud