diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2022-10-21 13:39:15 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2022-10-21 16:35:46 +0900 |
commit | e026368061c56bc925aff58910a4b02f18b78c70 (patch) | |
tree | d4934806d3d9fa62957121d2e7f8dfacc050439b /range.c | |
parent | e72c5044cec4bb881300c3a4ade839d0882ec9db (diff) | |
download | ruby-e026368061c56bc925aff58910a4b02f18b78c70.tar.gz |
Range#size returns nil for (.."a") and (nil..)
Fixes [Bug #18983]
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -816,7 +816,9 @@ range_size(VALUE range) } } else if (NIL_P(b)) { - return DBL2NUM(HUGE_VAL); + if (rb_obj_is_kind_of(e, rb_cNumeric)) { + return DBL2NUM(HUGE_VAL); + } } return Qnil; |