diff options
author | Torok Edwin <edwintorok@gmail.com> | 2008-11-29 08:52:45 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2008-11-29 08:52:45 +0000 |
commit | 10ca770020e12cf86d43f7b15cb6959e380e935d (patch) | |
tree | b4427fe602e80eac0540a4ce5c8750d50fae164e | |
parent | 25a081439f2c48a384c69ba8ad5e9ae005f4cf10 (diff) |
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
-rw-r--r-- | include/llvm/ADT/PointerIntPair.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/PointerIntPair.h b/include/llvm/ADT/PointerIntPair.h index 4c4bb7dd08..5a9425457d 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<intptr_t>(getPointer()) | (intptr_t)Int; } |