~ chicken-core (chicken-5) 049dfc0d563cf1dcc047d541f7b37c06ba058280


commit 049dfc0d563cf1dcc047d541f7b37c06ba058280
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Fri Sep 3 09:30:39 2010 -0400
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Fri Sep 3 09:30:39 2010 -0400

    fx-overflow op fixes

diff --git a/runtime.c b/runtime.c
index eee31556..d844546f 100644
--- a/runtime.c
+++ b/runtime.c
@@ -8649,13 +8649,21 @@ C_regparm C_word C_fcall C_i_o_fixnum_times(C_word n1, C_word n2)
   }
 
  ok:
-  return C_fix(x1 * x2);
+  x1 = x1 * x2;
+  
+  if(C_fitsinfixnump(x1)) return C_fix(x1);
+  else return C_SCHEME_FALSE;
 }
 
 
 C_regparm C_word C_fcall C_i_o_fixnum_quotient(C_word n1, C_word n2)
 {
   C_word x1, x2;
+#ifdef C_SIXTY_FOUR
+  static int eight_0 = 0x8000000000000000;
+#else
+  static int eight_0 = 0x80000000;
+#endif
 
   if((n1 & C_FIXNUM_BIT) == 0 || (n2 & C_FIXNUM_BIT) == 0) return C_SCHEME_FALSE;
 
@@ -8671,7 +8679,10 @@ C_regparm C_word C_fcall C_i_o_fixnum_quotient(C_word n1, C_word n2)
   if(x1 == 0x80000000L && x2 == -1) return C_SCHEME_FALSE;
 #endif
 
-  return C_fix(x1 / x2);
+  x1 = x1 / x2;
+
+  if(C_fitsinfixnump(x1)) return C_fix(x1);
+  else return C_SCHMEME_FALSE;
 }
 
 
Trap