diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-01 09:37:08 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-01 09:37:08 +0000 |
| commit | 3202eea1a1f5acf939d79b382f118ecfddf2c393 (patch) | |
| tree | 033c281fa09d038210732b07f7aa3c6aca0efcc0 | |
| parent | 0ca24ab21d507f4fd3130874e3b0c2902e72cf90 (diff) | |
* thread.c (thread_s_kill): workaround for [ruby-core:35086].
fixes #4367.
* test/ruby/test_thread.rb (TestThread#test_kill_wrong_argument):
test for [ruby-core:35086].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | test/ruby/test_thread.rb | 7 | ||||
| -rw-r--r-- | thread.c | 5 | ||||
| -rw-r--r-- | version.h | 2 |
4 files changed, 21 insertions, 1 deletions
@@ -1,3 +1,11 @@ +Wed Apr 6 21:25:08 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp> + + * thread.c (thread_s_kill): workaround for [ruby-core:35086]. + fixes #4367. + + * test/ruby/test_thread.rb (TestThread#test_kill_wrong_argument): + test for [ruby-core:35086]. + Fri Feb 4 12:11:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> * string.c (str_utf8_nth): fixed a conditon of optimized lead diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index b8c507a73e..179af08341 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -300,6 +300,13 @@ class TestThread < Test::Unit::TestCase INPUT end + def test_kill_wrong_argument + bug4367 = '[ruby-core:35086]' + assert_raise(TypeError, bug4367) { + Thread.kill(nil) + } + end + def test_exit s = 0 Thread.new do @@ -1509,6 +1509,11 @@ rb_thread_kill(VALUE thread) static VALUE rb_thread_s_kill(VALUE obj, VALUE th) { + if (CLASS_OF(th) != rb_cThread) { + rb_raise(rb_eTypeError, + "wrong argument type %s (expected Thread)", + rb_obj_classname(th)); + } return rb_thread_kill(th); } @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 189 +#define RUBY_PATCHLEVEL 190 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |
