diff --git a/vm/math.cpp b/vm/math.cpp index f6419dd025..45b5e71106 100644 --- a/vm/math.cpp +++ b/vm/math.cpp @@ -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) diff --git a/vm/math.hpp b/vm/math.hpp index 04daf74d90..7f5a634e13 100644 --- a/vm/math.hpp +++ b/vm/math.hpp @@ -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; } diff --git a/vm/vm.hpp b/vm/vm.hpp index 9281fdbb88..49499b5cbe 100644 --- 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);