[macruby-changes] [5221] MacRuby/trunk/thread.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 7 14:05:14 PST 2011


Revision: 5221
          http://trac.macosforge.org/projects/ruby/changeset/5221
Author:   lsansonetti at apple.com
Date:     2011-02-07 14:05:12 -0800 (Mon, 07 Feb 2011)
Log Message:
-----------
fix a bug in Thread.kill when passing a non-Thread object would cause a crash

Modified Paths:
--------------
    MacRuby/trunk/thread.c

Modified: MacRuby/trunk/thread.c
===================================================================
--- MacRuby/trunk/thread.c	2011-02-04 02:24:53 UTC (rev 5220)
+++ MacRuby/trunk/thread.c	2011-02-07 22:05:12 UTC (rev 5221)
@@ -377,6 +377,10 @@
 static VALUE
 rb_thread_s_kill(VALUE obj, SEL sel, VALUE th)
 {
+    if (!rb_obj_is_kind_of(th, rb_cThread)) {
+	rb_raise(rb_eTypeError, "wrong argument type %s (expected Thread)",
+		rb_obj_classname(th));
+    }
     return rb_thread_kill(th, 0);
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110207/be77bf0e/attachment.html>


More information about the macruby-changes mailing list