[macruby-changes] [2780] MacRuby/trunk/dispatcher.cpp

source_changes at macosforge.org source_changes at macosforge.org
Sat Oct 10 13:28:34 PDT 2009


Revision: 2780
          http://trac.macosforge.org/projects/ruby/changeset/2780
Author:   lsansonetti at apple.com
Date:     2009-10-10 13:28:31 -0700 (Sat, 10 Oct 2009)
Log Message:
-----------
when handling a sel_of_type argument, handle the case when the selector may be nil

Modified Paths:
--------------
    MacRuby/trunk/dispatcher.cpp

Modified: MacRuby/trunk/dispatcher.cpp
===================================================================
--- MacRuby/trunk/dispatcher.cpp	2009-10-10 06:25:33 UTC (rev 2779)
+++ MacRuby/trunk/dispatcher.cpp	2009-10-10 20:28:31 UTC (rev 2780)
@@ -816,18 +816,20 @@
 		    // call is the future target.
 		    const int arg_i = arg->index;
 		    assert(arg_i >= 0);
-		    ID arg_selid = rb_to_id(argv[arg_i]);
-		    SEL arg_sel = sel_registerName(rb_id2name(arg_selid));
+		    if (argv[arg_i] != Qnil) {
+			ID arg_selid = rb_to_id(argv[arg_i]);
+			SEL arg_sel = sel_registerName(rb_id2name(arg_selid));
 
-		    if (reinstall_method_maybe(*(Class *)ocrcv, arg_sel,
-			    arg->sel_of_type)) {
-			goto sel_target_found;
-		    }
-		    for (int j = 0; j < argc; j++) {
-			if (j != arg_i && !SPECIAL_CONST_P(argv[j])) {
-			    if (reinstall_method_maybe(*(Class *)argv[j],
-					arg_sel, arg->sel_of_type)) {
-				goto sel_target_found;
+			if (reinstall_method_maybe(*(Class *)ocrcv, arg_sel,
+				    arg->sel_of_type)) {
+			    goto sel_target_found;
+			}
+			for (int j = 0; j < argc; j++) {
+			    if (j != arg_i && !SPECIAL_CONST_P(argv[j])) {
+				if (reinstall_method_maybe(*(Class *)argv[j],
+					    arg_sel, arg->sel_of_type)) {
+				    goto sel_target_found;
+				}
 			    }
 			}
 		    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091010/18539b1d/attachment.html>


More information about the macruby-changes mailing list