hash.c: fix infinite loop

* hash.c (has_extra_methods): traverse ancestors, and fix infinite
  loop.  [Bug #9275]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-23 09:01:05 +00:00
parent cb62186b07
commit bc159ec502

1
hash.c
View File

@ -41,6 +41,7 @@ has_extra_methods(VALUE klass)
while (c != base) { while (c != base) {
st_table *mtbl = RCLASS_M_TBL(c); st_table *mtbl = RCLASS_M_TBL(c);
if (mtbl && mtbl->num_entries) return klass; if (mtbl && mtbl->num_entries) return klass;
c = RCLASS_SUPER(c);
} }
return 0; return 0;
} }