ruby-changes:19362
From: yugui <ko1@a...>
Date: Sun, 1 May 2011 18:37:26 +0900 (JST)
Subject: [ruby-changes:19362] Ruby:r31402 (ruby_1_9_2): * thread.c (thread_s_kill): workaround for .
yugui 2011-05-01 18:37:08 +0900 (Sun, 01 May 2011) New Revision: 31402 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31402 Log: * 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]. Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/test/ruby/test_thread.rb branches/ruby_1_9_2/thread.c branches/ruby_1_9_2/version.h Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 31401) +++ ruby_1_9_2/ChangeLog (revision 31402) @@ -1,3 +1,11 @@ +Wed Apr 6 21:25:08 2011 Yuki Sonoda (Yugui) <yugui@y...> + + * 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@g...> * string.c (str_utf8_nth): fixed a conditon of optimized lead Index: ruby_1_9_2/thread.c =================================================================== --- ruby_1_9_2/thread.c (revision 31401) +++ ruby_1_9_2/thread.c (revision 31402) @@ -1509,6 +1509,11 @@ 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); } Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 31401) +++ ruby_1_9_2/version.h (revision 31402) @@ -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 Index: ruby_1_9_2/test/ruby/test_thread.rb =================================================================== --- ruby_1_9_2/test/ruby/test_thread.rb (revision 31401) +++ ruby_1_9_2/test/ruby/test_thread.rb (revision 31402) @@ -300,6 +300,13 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/