~ chicken-core (chicken-5) c7919bab222100196314bee5692f7da3078c3597


commit c7919bab222100196314bee5692f7da3078c3597
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Fri Jul 3 20:57:35 2015 +0200
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Fri Jul 3 20:57:35 2015 +0200

    Fix double C_fix wrap in ratcmp code, resulting in wrong temporary bignum sizes

diff --git a/runtime.c b/runtime.c
index ce2d80fa..036107c6 100644
--- a/runtime.c
+++ b/runtime.c
@@ -9277,12 +9277,12 @@ static C_word rat_cmp(C_word x, C_word y)
    * extreme cases.  This is a tradeoff we make so that comparisons
    * are inlineable, which makes a big difference for the common case.
    */
-  ssize = C_fix(C_bignum_size(x1) + C_bignum_size(y2));
+  ssize = C_bignum_size(x1) + C_bignum_size(y2);
   negp = C_mk_bool(C_bignum_negativep(x1));
   s = allocate_tmp_bignum(C_fix(ssize), negp, C_SCHEME_TRUE);
   bignum_digits_multiply(x1, y2, s); /* Swap args if x1 < y2? */
 
-  tsize = C_fix(C_bignum_size(y1) + C_bignum_size(x2));
+  tsize = C_bignum_size(y1) + C_bignum_size(x2);
   negp = C_mk_bool(C_bignum_negativep(y1));
   t = allocate_tmp_bignum(C_fix(tsize), negp, C_SCHEME_TRUE);
   bignum_digits_multiply(y1, x2, t); /* Swap args if y1 < x2? */
Trap