Issue #392 - Do not reference double as bignum

Fixed copy-and-paste issue that could lead to crashes and undefined behavior.
This commit is contained in:
Justin Ethier 2020-06-29 12:19:47 -04:00
parent 58fdd74da3
commit ad95e0e2c4
2 changed files with 2 additions and 1 deletions

View file

@ -8,6 +8,7 @@ Features
Bug Fixes
- Fixed a bug in the oprimized numeric comparison operators when comparing a double with a bignum, that could lead to undefined behavior.
- Fixed `make_empty_bytevector` and `make_c_opaque` parameters on `(cyclone foreign)`.
## 0.18 - June 8, 2020

View file

@ -1818,7 +1818,7 @@ object FUNC_FAST_OP(void *data, object x, object y) { \
} else if (tx == -1 && ty == bignum_tag) { \
return Cyc_bignum_cmp(BN_CMP, x, tx, y, ty) ? boolean_t : boolean_f; \
} else if (tx == double_tag && ty == bignum_tag) { \
return (double_value(x)) OP mp_get_double(&bignum_value(x)) ? boolean_t : boolean_f; \
return (double_value(x)) OP mp_get_double(&bignum_value(y)) ? boolean_t : boolean_f; \
} else if (tx == complex_num_tag && ty == complex_num_tag) { \
return ((complex_num_value(x)) == (complex_num_value(y))) ? boolean_t : boolean_f; \
} else if (tx == complex_num_tag && ty != complex_num_tag) { \