From fc3eb09a0f5d05a9f93f6b4859a5aff40db81a2b Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 16 Feb 2009 22:21:33 +0000 Subject: [PATCH] Modify getMaxValue/getMinValue to take pointer values as well. llvm-svn: 64682 --- .../clang/Analysis/PathSensitive/BasicValueFactory.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h b/clang/include/clang/Analysis/PathSensitive/BasicValueFactory.h index a49496278974..f25bf5da1d3d 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) {