1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* bignum.c (rb_big_aref): check for Bignum index range.

[ruby-dev:31271]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-07-30 02:16:42 +00:00
parent 7e168983ce
commit 798b8d2791
4 changed files with 37 additions and 15 deletions

View file

@ -117,6 +117,13 @@ class TestInteger < Test::Unit::TestCase
end
}
}
# [ruby-dev:31271]
# assert_equal(1, (1 << 0x40000000)[0x40000000])
# assert_equal(0, (-1 << 0x40000001)[0x40000000])
big_zero = 0x40000000.coerce(0)[0]
assert_equal(0, (-0x40000002)[big_zero])
assert_equal(1, 0x400000001[big_zero])
end
def test_plus