Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[fix #153] fix a bug which fails looking up method when call super fr…

…om block in #define_method
  • Loading branch information...
commit d900e4bf92cb1342b40aa83f5b1fe699a61a8d59 1 parent b0d332f
Watson Watson1978 authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 dispatcher.cpp
12 dispatcher.cpp
View
@@ -606,6 +606,18 @@ rb_vm_dispatch(void *_vm, struct mcache *cache, VALUE top, VALUE self,
Method method;
if (opt & DISPATCH_SUPER) {
if (!sel_equal(klass, current_super_sel, sel)) {
+ const char *selname = sel_getName(sel);
+ const size_t selname_len = strlen(selname);
+ char buf[100];
+ if (argc == 0 && selname[selname_len - 1] == ':') {
+ strlcpy(buf, selname, sizeof buf);
+ buf[selname_len - 1] = '\0';
+ sel = sel_registerName(buf);
+ }
+ else if (argc > 0 && selname[selname_len - 1] != ':') {
+ snprintf(buf, sizeof buf, "%s:", selname);
+ sel = sel_registerName(buf);
+ }
current_super_sel = sel;
current_super_class = klass;
}
Please sign in to comment.
Something went wrong with that request. Please try again.