summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-12 16:51:47 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-12 16:51:47 +0000
commita9bd53085a928026806bf8af244532bfb6dd742f (patch)
treeec5a8fb66db3cfb8370c786ae691418957272d75 /test
parentae996ed47b9367fd0bff98fad37a95624c3868c2 (diff)
merge revision(s) 57797,57799,57800: [Backport #13289]
string.c: fix integer overflow * string.c (rb_str_subpos): fix integer overflow which can happen only when SHARABLE_MIDDLE_SUBSTRING is enabled. incorpolate https://github.com/mruby/mruby/commit/7db0786abdd243ba031e24683f string.c: fix integer overflow * string.c (str_byte_substr): fix another integer overflow which can happen only when SHARABLE_MIDDLE_SUBSTRING is enabled. [ruby-core:79951] [Bug #13289] string.c: negation of LONG_MIN * string.c (rb_str_update): do not use negation of LONG_MIN, which is negative too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_string.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 5b4e27e0fa..641f4abffe 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -202,6 +202,8 @@ CODE
assert_equal("fobar", s)
assert_raise(ArgumentError) { "foo"[1, 2, 3] = "" }
+
+ assert_raise(IndexError) {"foo"[RbConfig::Limits["LONG_MIN"]] = "l"}
end
def test_CMP # '<=>'