summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-08-07 11:19:00 -0400
committerBen Gamari <ben@well-typed.com>2019-08-10 06:23:51 -0400
commit32f7abf781b2b99622c0405b21277f4a614b80bb (patch)
tree4b098f54b0a7b730a77acda03b921288183a76a9
parent4f027e72b871a973a525904edeccc53171a78a21 (diff)
downloadhaskell-32f7abf781b2b99622c0405b21277f4a614b80bb.tar.gz
base: Don't inline eqTypeRep
Issue #16893 reveals that the unsafeCoercion# in eqTypeRep can float in a way that compromises type safety. A real solution for this sadly won't be ready for 8.10 so this is a stop-gap measure for 8.8.
-rw-r--r--libraries/base/Data/Typeable/Internal.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/libraries/base/Data/Typeable/Internal.hs b/libraries/base/Data/Typeable/Internal.hs
index 1be6e27b74..7c3a7d32ff 100644
--- a/libraries/base/Data/Typeable/Internal.hs
+++ b/libraries/base/Data/Typeable/Internal.hs
@@ -569,7 +569,9 @@ eqTypeRep a b
-- in the usual case that it is scrutinized immediately. We
-- split eqTypeRep into a worker and wrapper because otherwise
-- it's much larger than anything we'd want to inline.
-{-# INLINABLE eqTypeRep #-}
+--
+-- However, due to #16893 it is currently unsafe to do so, hence the NOINLINE.
+{-# NOINLINE eqTypeRep #-}
sameTypeRep :: forall k1 k2 (a :: k1) (b :: k2).
TypeRep a -> TypeRep b -> Bool