summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-01 09:37:08 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-01 09:37:08 +0000
commit3202eea1a1f5acf939d79b382f118ecfddf2c393 (patch)
tree033c281fa09d038210732b07f7aa3c6aca0efcc0 /thread.c
parent0ca24ab21d507f4fd3130874e3b0c2902e72cf90 (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
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 09a9f94fac..669c7bdd65 100644
--- a/thread.c
+++ b/thread.c
@@ -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);
}