From 97b8e4996f2aa92fe687415bebd700954af6eab5 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 24 Jan 2011 12:04:47 +0000 Subject: * error.c (rb_invalid_str): prevent intermediate variable from GC. [ruby-core:34820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_float.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 7ab4ffc649..85faf63355 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -472,6 +472,11 @@ class TestFloat < Test::Unit::TestCase assert(Float(o).nan?) end + def test_invalid_str + bug4310 = '[ruby-core:34820]' + assert_raise(ArgumentError, bug4310) {under_gc_stress {Float('a'*10000)}} + end + def test_num2dbl assert_raise(TypeError) do 1.0.step(2.0, "0.5") {} -- cgit v1.2.3