]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: generate a to_fixnum_strict to workaround an odd io.monitors issue.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 7 Jun 2014 19:06:03 +0000 (12:06 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 7 Jun 2014 19:06:03 +0000 (12:06 -0700)
vm/math.cpp
vm/math.hpp
vm/vm.hpp

index f6419dd0255e33c921ba07b2d4d69815a621c2a6..45b5e711061215c275ef6e885309e3089c1e248a 100644 (file)
@@ -298,8 +298,8 @@ void factor_vm::primitive_bits_double() {
     return parent->name(tagged);                        \
   }
 
-/* Note that to_fixnum, unlike the others, is strict. */
-CELL_TO_FOO(to_fixnum, fixnum, bignum_to_fixnum_strict)
+CELL_TO_FOO(to_fixnum, fixnum, bignum_to_fixnum)
+CELL_TO_FOO(to_fixnum_strict, fixnum, bignum_to_fixnum_strict)
 CELL_TO_FOO(to_cell, cell, bignum_to_cell)
 CELL_TO_FOO(to_signed_8, int64_t, bignum_to_long_long)
 CELL_TO_FOO(to_unsigned_8, uint64_t, bignum_to_ulong_long)
index 04daf74d90ad33ea6f8b6273c2e76d1139b62792..7f5a634e13d743fb386fbc24767f1ce7dac63126 100644 (file)
@@ -51,7 +51,7 @@ inline double factor_vm::fixnum_to_float(cell tagged) {
 
 inline cell factor_vm::unbox_array_size() {
   cell obj = ctx->pop();
-  fixnum n = to_fixnum(obj);
+  fixnum n = to_fixnum_strict(obj);
   if (n >= 0 && n < (fixnum)array_size_max) {
     return n;
   }
index 9281fdbb887df2280e2f29a488547597e9f1008a..49499b5cbefae86c5077da37a9643903525c0d5d 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -523,6 +523,7 @@ struct factor_vm {
   void primitive_double_bits();
   void primitive_bits_double();
   fixnum to_fixnum(cell tagged);
+  fixnum to_fixnum_strict(cell tagged);
   cell to_cell(cell tagged);
   cell from_signed_8(int64_t n);
   int64_t to_signed_8(cell obj);