Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

when changing the visibility of a method and duplicating its entry in…

… the lookup table, be sure to keep the same flags too

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@3161 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
commit d3eea39cb5005fd72b874abd6981173a61d32f41 1 parent 27e64f5
Laurent Sansonetti authored
Showing with 13 additions and 3 deletions.
  1. +13 −3 vm_method.c
View
16 vm_method.c
@@ -209,10 +209,20 @@ rb_export_method(VALUE klass, ID name, ID noex)
VALUE sklass = RCLASS_SUPER(klass);
if (sklass != 0) {
- Method m = class_getInstanceMethod((Class)sklass, sel);
- if (m != NULL && method_getImplementation(m) == node->objc_imp) {
+ IMP imp;
+ rb_vm_method_node_t *snode;
+ if (rb_vm_lookup_method((Class)sklass, sel, &imp, &snode)
+ && imp == node->objc_imp) {
// The method actually exists on a superclass, we need to duplicate
- // it to the current class.
+ // it to the current class, keeping the same flags.
+ if (snode != NULL) {
+ if (snode->flags & VM_METHOD_EMPTY) {
+ flags |= VM_METHOD_EMPTY;
+ }
+ if (snode->flags & VM_METHOD_FBODY) {
+ flags |= VM_METHOD_FBODY;
+ }
+ }
rb_vm_define_method2((Class)klass, sel, node, flags, false);
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.