Revision
772
Author
lsansonetti@apple.com
Date
2008-12-24 18:30:58 -0800 (Wed, 24 Dec 2008)

Log Message

fix a bug when looking at the bridgesupport signature for metho type (thanks Vincent Isambart)

Modified Paths

Diff

Modified: MacRuby/trunk/objc.m (771 => 772)


--- MacRuby/trunk/objc.m	2008-12-24 15:21:11 UTC (rev 771)
+++ MacRuby/trunk/objc.m	2008-12-25 02:30:58 UTC (rev 772)
@@ -1024,14 +1024,20 @@
 			char *type, size_t type_len)
 {
     if (bs_method != NULL) {
-	unsigned i;
-	if (n == -1 && bs_method->retval != NULL)
-	    return bs_method->retval->type;	    
-	for (i = 0; i < bs_method->args_count; i++) {
-	    if (bs_method->args[i].index == i
-		&& bs_method->args[i].type != NULL)
-		return bs_method->args[i].type; 
+	if (n == -1) {
+	    if (bs_method->retval != NULL) {
+		return bs_method->retval->type;
+	    }
 	}
+	else {	    
+	    unsigned i;
+	    for (i = 0; i < bs_method->args_count; i++) {
+		if (bs_method->args[i].index == n
+		    && bs_method->args[i].type != NULL) {
+		    return bs_method->args[i].type; 
+		}
+	    }
+	}
     }
     if (n == -1) {
 	method_getReturnType(method, type, type_len);