diff options
| -rw-r--r-- | src/kernel.c | 2 | ||||
| -rw-r--r-- | test/t/module.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/kernel.c b/src/kernel.c index 2f52c7bdf..22fe40218 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -614,7 +614,7 @@ method_entry_loop(mrb_state *mrb, struct RClass* klass, khash_t(st)* set) khash_t(mt) *h = klass->mt; if (!h) return; for (i=0;i<kh_end(h);i++) { - if (kh_exist(h, i)) { + if (kh_exist(h, i) && kh_value(h, i)) { kh_put(st, mrb, set, kh_key(h, i)); } } diff --git a/test/t/module.rb b/test/t/module.rb index 8503cb9fc..9852328ce 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -469,6 +469,7 @@ assert('Module#undef_method', '15.2.2.4.42') do assert_true Test4UndefMethod::Parent.new.respond_to?(:hello) assert_false Test4UndefMethod::Child.new.respond_to?(:hello) assert_false Test4UndefMethod::GrandChild.new.respond_to?(:hello) + assert_false Test4UndefMethod::Child.instance_methods(false).include? :hello end # Not ISO specified |
