vm: generate a to_fixnum_strict to workaround an odd io.monitors issue.

db4
John Benediktsson 2014-06-07 12:06:03 -07:00
parent 53a9c43b31
commit e9e1fd4e6a
3 changed files with 4 additions and 3 deletions

View File

@ -298,8 +298,8 @@ void factor_vm::primitive_bits_double() {
return parent->name(tagged); \ return parent->name(tagged); \
} }
/* Note that to_fixnum, unlike the others, is strict. */ CELL_TO_FOO(to_fixnum, fixnum, bignum_to_fixnum)
CELL_TO_FOO(to_fixnum, fixnum, bignum_to_fixnum_strict) CELL_TO_FOO(to_fixnum_strict, fixnum, bignum_to_fixnum_strict)
CELL_TO_FOO(to_cell, cell, bignum_to_cell) 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_signed_8, int64_t, bignum_to_long_long)
CELL_TO_FOO(to_unsigned_8, uint64_t, bignum_to_ulong_long) CELL_TO_FOO(to_unsigned_8, uint64_t, bignum_to_ulong_long)

View File

@ -51,7 +51,7 @@ inline double factor_vm::fixnum_to_float(cell tagged) {
inline cell factor_vm::unbox_array_size() { inline cell factor_vm::unbox_array_size() {
cell obj = ctx->pop(); cell obj = ctx->pop();
fixnum n = to_fixnum(obj); fixnum n = to_fixnum_strict(obj);
if (n >= 0 && n < (fixnum)array_size_max) { if (n >= 0 && n < (fixnum)array_size_max) {
return n; return n;
} }

View File

@ -523,6 +523,7 @@ struct factor_vm {
void primitive_double_bits(); void primitive_double_bits();
void primitive_bits_double(); void primitive_bits_double();
fixnum to_fixnum(cell tagged); fixnum to_fixnum(cell tagged);
fixnum to_fixnum_strict(cell tagged);
cell to_cell(cell tagged); cell to_cell(cell tagged);
cell from_signed_8(int64_t n); cell from_signed_8(int64_t n);
int64_t to_signed_8(cell obj); int64_t to_signed_8(cell obj);