diff options
author | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-10 00:47:31 +0000 |
---|---|---|
committer | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-10 00:47:31 +0000 |
commit | d22e08f9375dbc0d0a962751d1c57f17b22f01b6 (patch) | |
tree | ba23d24361d4967fc78249a44f606d0b75bba4df /range.c | |
parent | b1d647c809a86b8068a327ce2398c89c3823dc61 (diff) | |
download | ruby-d22e08f9375dbc0d0a962751d1c57f17b22f01b6.tar.gz |
* range.c (range_max): fix behavior with excluded end value.
[Bug #4591]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -665,6 +665,9 @@ range_max(VALUE range) rb_raise(rb_eTypeError, "cannot exclude non Integer end value"); } if (c == 0) return Qnil; + if (!FIXNUM_P(b) && !rb_obj_is_kind_of(b,rb_cInteger)) { + rb_raise(rb_eTypeError, "cannot exclude end value with non Integer begin value"); + } if (FIXNUM_P(e)) { return LONG2NUM(FIX2LONG(e) - 1); } |