From 7f54c665a2ddfb3471e7978f85ee307ff64edbaf Mon Sep 17 00:00:00 2001 From: Torok Edwin Date: Sat, 29 Nov 2008 08:52:45 +0000 Subject: [PATCH] protect against negative values that would exceed allowed bit width llvm-svn: 60239 --- include/llvm/ADT/PointerIntPair.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/ADT/PointerIntPair.h b/include/llvm/ADT/PointerIntPair.h index 4c4bb7dd081..5a9425457dd 100644 --- a/include/llvm/ADT/PointerIntPair.h +++ b/include/llvm/ADT/PointerIntPair.h @@ -53,7 +53,7 @@ public: } void setInt(IntType Int) { - assert(Int < (1 << IntBits) && "Integer too large for field"); + assert(unsigned(Int) < (1 << IntBits) && "Integer too large for field"); Value = reinterpret_cast(getPointer()) | (intptr_t)Int; }