We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5f44b58 + b8bfd93 commit 0618f4bCopy full SHA for 0618f4b
Data/Vector/Fusion/Bundle/Size.hs
@@ -51,7 +51,8 @@ instance Num Size where
51
{-# INLINE checkedAdd #-}
52
checkedAdd :: (Int -> Size) -> Int -> Int -> Size
53
checkedAdd con m n
54
- | r <= m =
+ -- Note: we assume m and n are >= 0.
55
+ | r < m || r < n =
56
error $ "Data.Vector.Fusion.Bundle.Size.checkedAdd: overflow: " ++ show r
57
| otherwise = con r
58
where
0 commit comments