From 70189a8cfd0e06230984b1033635d532c543e39d Mon Sep 17 00:00:00 2001 From: ktsj Date: Sun, 31 Jul 2011 02:32:48 +0000 Subject: * vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_thread.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index daccadde78..c16aa87896 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -604,6 +604,18 @@ class TestThread < Test::Unit::TestCase end INPUT end + + def test_no_valid_cfp + bug5083 = '[ruby-dev:44208]' + error = assert_raise(RuntimeError) do + Thread.new(&Module.method(:nesting)).join + end + assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083) + error = assert_raise(RuntimeError) do + Thread.new(:to_s, &Module.method(:undef_method)).join + end + assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083) + end end class TestThreadGroup < Test::Unit::TestCase -- cgit v1.2.3