diff options
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2057,6 +2057,7 @@ rb_to_integer(VALUE val, const char *method) VALUE v; if (FIXNUM_P(val)) return val; + if (TYPE(val) == T_BIGNUM) return val; v = convert_type(val, "Integer", method, Qtrue); if (!rb_obj_is_kind_of(v, rb_cInteger)) { const char *cname = rb_obj_classname(val); @@ -2072,6 +2073,7 @@ rb_check_to_integer(VALUE val, const char *method) VALUE v; if (FIXNUM_P(val)) return val; + if (TYPE(val) == T_BIGNUM) return val; v = convert_type(val, "Integer", method, Qfalse); if (!rb_obj_is_kind_of(v, rb_cInteger)) { return Qnil; |