Skip to content

Commit

Permalink
Need to convert the return value of rb_big_cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkn committed Jan 6, 2021
1 parent 686487d commit c8de503
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,7 @@ rb_big_convert_to_BigDecimal(VALUE val, RB_UNUSED_VAR(size_t digs), int raise_ex
assert(RB_TYPE_P(val, T_BIGNUM));

size_t size = rb_absint_size(val, NULL);
int sign = rb_big_cmp(val, INT2FIX(0));
int sign = FIX2INT(rb_big_cmp(val, INT2FIX(0)));
if (size <= sizeof(long)) {
if (sign < 0) {
return rb_int64_convert_to_BigDecimal(NUM2LONG(val), digs, raise_exception);
Expand Down

0 comments on commit c8de503

Please sign in to comment.