From be007d6eae988b657f639446ba6ff2bf0ddefa72 Mon Sep 17 00:00:00 2001 From: yugui Date: Fri, 28 Jan 2011 02:25:35 +0000 Subject: merges r30641 from trunk into ruby_1_9_2. -- * error.c (rb_invalid_str): prevent intermediate variable from GC. [ruby-core:34820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_float.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index fffa96e313..b465814140 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -442,6 +442,18 @@ class TestFloat < Test::Unit::TestCase assert(Float(o).nan?) end + def test_invalid_str + bug4310 = '[ruby-core:34820]' + assert_raise(ArgumentError, bug4310) { + stress, GC.stress = GC.stress, true + begin + Float('a'*10000) + ensure + GC.stress = stress + end + } + end + def test_num2dbl assert_raise(TypeError) do 1.0.step(2.0, "0.5") {} -- cgit v1.2.3