Commit bff74de7 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

Bignum: make GMP's bignat_add not recursive

bignat_add was a loopbreaker with an INLINE pragma (spotted by
@mpickering). This patch makes it non recursive to avoid the issue.
parent 37f0434d
......@@ -70,13 +70,13 @@ bignat_add
-> State# RealWorld
{-# INLINE bignat_add #-}
bignat_add mwa wa wb s
-- weird GMP requirement
-- weird GMP requirement: the biggest comes first
| isTrue# (wordArraySize# wb ># wordArraySize# wa)
= bignat_add mwa wb wa s
= case ioWord# (c_mpn_add mwa wb (wordArraySize# wb) wa (wordArraySize# wa)) s of
(# s', c #) -> mwaWriteMostSignificant mwa c s'
| True
= do
case ioWord# (c_mpn_add mwa wa (wordArraySize# wa) wb (wordArraySize# wb)) s of
= case ioWord# (c_mpn_add mwa wa (wordArraySize# wa) wb (wordArraySize# wb)) s of
(# s', c #) -> mwaWriteMostSignificant mwa c s'
bignat_add_word
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment