[macruby-changes] [3572] MacRuby/trunk/vm.cpp

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 17 14:27:55 PST 2010


Revision: 3572
          http://trac.macosforge.org/projects/ruby/changeset/3572
Author:   martinlagardette at apple.com
Date:     2010-02-17 14:27:55 -0800 (Wed, 17 Feb 2010)
Log Message:
-----------

 - Make sure we invalidate a method cache when redefining it
 - Fixes #555

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

Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp	2010-02-17 12:33:52 UTC (rev 3571)
+++ MacRuby/trunk/vm.cpp	2010-02-17 22:27:55 UTC (rev 3572)
@@ -2163,7 +2163,10 @@
 	    // If we add -[foo:] and the class responds to -[foo], we need
 	    // to disable it (and vice-versa).
 	    class_replaceMethod(klass, new_sel,
-		    (IMP)rb_vm_undefined_imp, method_getTypeEncoding(tmp_m));	
+		    (IMP)rb_vm_undefined_imp, method_getTypeEncoding(tmp_m));
+	    // Invalidate the cache so that the previously defined
+	    // implementation is not called anymore if the call was cached
+	    GET_CORE()->invalidate_method_cache(new_sel);
 	}
     }
 
@@ -2604,7 +2607,6 @@
 {
     assert(node != NULL);
 
-    
     if (flags == -1) {
 	flags = node->flags;
 	flags &= ~VM_METHOD_PRIVATE;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100217/dcbe4932/attachment.html>


More information about the macruby-changes mailing list