[macruby-changes] [349] MacRuby/trunk/objc.m
source_changes at macosforge.org
source_changes at macosforge.org
Wed Jul 9 23:10:25 PDT 2008
Revision: 349
http://trac.macosforge.org/projects/ruby/changeset/349
Author: lsansonetti at apple.com
Date: 2008-07-09 23:10:25 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
fixed a bug in the super dispatch, discovered by limechat
Modified Paths:
--------------
MacRuby/trunk/objc.m
Modified: MacRuby/trunk/objc.m
===================================================================
--- MacRuby/trunk/objc.m 2008-07-09 23:03:30 UTC (rev 348)
+++ MacRuby/trunk/objc.m 2008-07-10 06:10:25 UTC (rev 349)
@@ -1143,7 +1143,8 @@
if (super_call) {
Method smethod;
smethod = class_getInstanceMethod(klass, ctx->selector);
- assert(smethod != ctx->method);
+ if (klass == ctx->klass)
+ assert(smethod != ctx->method);
imp = method_getImplementation(smethod);
assert(imp != NULL);
}
@@ -1269,13 +1270,15 @@
if (super_call) {
Class sklass = klass;
+ Method orig_method = ctx->klass == klass
+ ? ctx->method : class_getInstanceMethod(klass, ctx->selector);
for (;;) {
Method smethod;
sklass = class_getSuperclass(sklass);
if (sklass == NULL)
break;
smethod = class_getInstanceMethod(sklass, ctx->selector);
- if (smethod != ctx->method) {
+ if (smethod != orig_method) {
klass = sklass;
break;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080709/9bec9746/attachment.html
More information about the macruby-changes
mailing list