mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
cb62186b07
commit
bc159ec502
1 changed files with 1 additions and 0 deletions
1
hash.c
1
hash.c
|
@ -41,6 +41,7 @@ has_extra_methods(VALUE klass)
|
|||
while (c != base) {
|
||||
st_table *mtbl = RCLASS_M_TBL(c);
|
||||
if (mtbl && mtbl->num_entries) return klass;
|
||||
c = RCLASS_SUPER(c);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue