File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -198,14 +198,14 @@ int = "Z.Data.Parser.Numeric.int" <?> do
198198 bs <- P. takeWhile1 isDigit
199199 if V. length bs <= INT64_MAX_DIGITS_LEN
200200 then do
201- let i64 = decLoop @ Int64 0 bs
202- if i64 <= negate ( fromIntegral (minBound :: a ) )
203- then return (fromIntegral ( negate i64) )
201+ let i64 = negate ( decLoop @ Int64 0 bs)
202+ if i64 >= fromIntegral (minBound :: a )
203+ then return (fromIntegral i64)
204204 else P. fail' " decimal numeric value overflow"
205205 else do
206- let i64 = decLoop @ Integer 0 bs
207- if i64 <= negate ( fromIntegral (minBound :: a ) )
208- then return (fromIntegral ( negate i64) )
206+ let i64 = negate ( decLoop @ Integer 0 bs)
207+ if i64 >= fromIntegral (minBound :: a )
208+ then return (fromIntegral i64)
209209 else P. fail' " decimal numeric value overflow"
210210
211211-- | Same with 'int', but sliently cast if overflow happens.
You can’t perform that action at this time.
0 commit comments