OSDN Git Service

Fix sentinels to use correctly 'aligned' pointers.
authorChris Lattner <sabre@nondot.org>
Sat, 29 Nov 2008 01:36:16 +0000 (01:36 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 29 Nov 2008 01:36:16 +0000 (01:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60229 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/PointerIntPair.h

index 60671da..f4518f0 100644 (file)
@@ -73,11 +73,11 @@ template<typename PointerTy, unsigned IntBits, typename IntType>
 struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType> > {
   typedef PointerIntPair<PointerTy, IntBits, IntType> Ty;
   static Ty getEmptyKey() {
-    return Ty(reinterpret_cast<PointerTy>(-1),
+    return Ty(reinterpret_cast<PointerTy>(-1 << IntBits),
               IntType((1 << IntBits)-1));
   }
   static Ty getTombstoneKey() {
-    return Ty(reinterpret_cast<PointerTy>(-2), IntType(0));
+    return Ty(reinterpret_cast<PointerTy>(-2 << IntBits), IntType(0));
   }
   static unsigned getHashValue(Ty V) {
     uintptr_t IV = reinterpret_cast<uintptr_t>(V.getOpaqueValue());