~ chicken-core (chicken-5) 42012ba9fb141525b885f339be700224ed64c671


commit 42012ba9fb141525b885f339be700224ed64c671
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Sat Nov 4 14:21:26 2017 +0100
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Sat Nov 4 14:21:26 2017 +0100

    Length is already less than BIGNUM_DIGIT_LENGTH at the end of the loop
    
    No need to use modulo, that's overkill.

diff --git a/runtime.c b/runtime.c
index 4f22989f..9d593784 100644
--- a/runtime.c
+++ b/runtime.c
@@ -12673,7 +12673,7 @@ C_s_a_u_i_random_int(C_word **ptr, C_word n, C_word rn)
     len -= sizeof(C_uword);
   }
 
-  *p = random_word() & ((1 << (len % C_BIGNUM_DIGIT_LENGTH)) - 1);
+  *p = random_word() & ((1 << len) - 1);
   return C_bignum_simplify(result);
 }
 
Trap