@@ -182,9 +182,9 @@ checkBounds _label _off _arr = do
182182-- single array for deserializing. But that can also be done by framing the
183183-- serialized value with a size header.
184184--
185−{-# INLINE deserializeUnsafe #-}
186−deserializeUnsafe :: forall a. Unbox a => Int -> MutByteArray -> Int -> IO (Int, a)
187−deserializeUnsafe off arr sz =
185+{-# INLINE deserializeChecked #-}
186+deserializeChecked :: forall a. Unbox a => Int -> MutByteArray -> Int -> IO (Int, a)
187+deserializeChecked off arr sz =
188188 let next = off + Unbox.sizeOf (Proxy :: Proxy a)
189189 in do
190190 -- Keep likely path in the straight branch.
@@ -211,7 +211,7 @@ instance Serialize _type where \
211211; {-# INLINE addSizeTo #-} \
212212; addSizeTo acc _ = acc + Unbox.sizeOf (Proxy :: Proxy _type) \
213213; {-# INLINE deserializeAt #-} \
214−; deserializeAt off arr end = deserializeUnsafe off arr end :: IO (Int, _type) \
214+; deserializeAt off arr end = deserializeChecked off arr end :: IO (Int, _type) \
215215; {-# INLINE serializeAt #-} \
216216; serializeAt = \
217217 serializeUnsafe :: Int -> MutByteArray -> _type -> IO Int