diff --git a/cbits/HeapViewPrim.cmm b/cbits/HeapViewPrim.cmm
--- a/cbits/HeapViewPrim.cmm
+++ b/cbits/HeapViewPrim.cmm
@@ -47,3 +47,11 @@
     RET_NPP(info, data_arr, ptrArray);
 }
 
+reallyUnsafePtrEqualityUpToTag
+{
+    W_ clos1;
+    W_ clos2;
+    clos1 = UNTAG(R1);
+    clos2 = UNTAG(R2);
+    RET_N(clos1 == clos2);
+}
diff --git a/ghc-heap-view.cabal b/ghc-heap-view.cabal
--- a/ghc-heap-view.cabal
+++ b/ghc-heap-view.cabal
@@ -1,5 +1,5 @@
 Name:                ghc-heap-view
-Version:             0.3.0.3
+Version:             0.3.0.4
 Synopsis:            Extract the heap representation of Haskell values and thunks
 Description:
   This library provides functions to introspect the Haskell heap, for example
diff --git a/src/GHC/HeapView.hs b/src/GHC/HeapView.hs
--- a/src/GHC/HeapView.hs
+++ b/src/GHC/HeapView.hs
@@ -66,9 +66,9 @@
           '0':'x':(replicate (2*wORD_SIZE - length ls) '0') ++ ls
 
 instance Eq Box where
-  Box a == Box b = case reallyUnsafePtrEquality# a b of
-    1# -> True
-    _  -> False
+  Box a == Box b = case reallyUnsafePtrEqualityUpToTag# a b of
+    0# -> False
+    _  -> True
 
 {-|
   This takes an arbitrary value and puts it into a box. Note that calls like
@@ -370,6 +370,7 @@
 #ifdef PRIM_SUPPORTS_ANY
 foreign import prim "aToWordzh" aToWord# :: Any -> Word#
 foreign import prim "slurpClosurezh" slurpClosure# :: Any -> (# Addr#, ByteArray#, Array# b #)
+foreign import prim "reallyUnsafePtrEqualityUpToTag" reallyUnsafePtrEqualityUpToTag# :: Any -> Any -> Int#
 #else
 -- Workd-around code until http://hackage.haskell.org/trac/ghc/ticket/5931 was
 -- accepted
@@ -377,6 +378,8 @@
 -- foreign import prim "aToWordzh" aToWord'# :: Addr# -> Word#
 foreign import prim "slurpClosurezh" slurpClosure'# :: Word#  -> (# Addr#, ByteArray#, Array# b #)
 
+foreign import prim "reallyUnsafePtrEqualityUpToTag" reallyUnsafePtrEqualityUpToTag'# :: Word# -> Word# -> Int#
+
 -- This is a datatype that has the same layout as Ptr, so that by
 -- unsafeCoerce'ing, we obtain the Addr of the wrapped value
 data Ptr' a = Ptr' a
@@ -386,6 +389,9 @@
 
 slurpClosure# :: Any -> (# Addr#, ByteArray#, Array# b #)
 slurpClosure# a = slurpClosure'# (aToWord# a)
+
+reallyUnsafePtrEqualityUpToTag# :: Any -> Any -> Int#
+reallyUnsafePtrEqualityUpToTag# a b = reallyUnsafePtrEqualityUpToTag'# (aToWord# a) (aToWord# b)
 #endif
 
 --pClosure x = do
