Revision
1481
Author
lsansonetti@apple.com
Date
2009-04-23 17:42:31 -0700 (Thu, 23 Apr 2009)

Log Message

when looking for a BS method signature, look through the class hierarchy and not only the given class

Modified Paths

Diff

Modified: MacRuby/branches/experimental/roxor.cpp (1480 => 1481)


--- MacRuby/branches/experimental/roxor.cpp	2009-04-23 23:43:48 UTC (rev 1480)
+++ MacRuby/branches/experimental/roxor.cpp	2009-04-24 00:42:31 UTC (rev 1481)
@@ -8672,21 +8672,26 @@
 	class_isMetaClass(klass) ? bs_classes_class_methods
 	: bs_classes_instance_methods;
 
-    std::map<std::string, std::map<SEL, bs_element_method_t *> *>::iterator
-	iter = map.find(class_getName(klass));
+    do {
+	std::map<std::string,
+		 std::map<SEL, bs_element_method_t *> *>::iterator iter =
+		     map.find(class_getName(klass));
 
-    if (iter == map.end()) {
-	return NULL;
-    }
+	if (iter != map.end()) {
+	    std::map<SEL, bs_element_method_t *> *map2 = iter->second;
+	    std::map<SEL, bs_element_method_t *>::iterator iter2 =
+		map2->find(sel);
 
-    std::map<SEL, bs_element_method_t *> *map2 = iter->second;
-    std::map<SEL, bs_element_method_t *>::iterator iter2 = map2->find(sel);
+	    if (iter2 != map2->end()) {
+		return iter2->second;
+	    }
+	}
 
-    if (iter2 == map2->end()) {
-	return NULL;
+	klass = class_getSuperclass(klass);
     }
+    while (klass != NULL);
 
-    return iter2->second;
+    return NULL;
 }
 
 inline rb_vm_bs_boxed_t *