From 10ca770020e12cf86d43f7b15cb6959e380e935d 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60239 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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; }