x and y will share iv_index_tbl hashes. However, the size of the hash will grow larger than the number if entries in ivptr in y. Before this commit, rb_ivar_count would use the size of the hash to determine how far to read in to the array, but this means that it could read past the end of the array and cause the program to segv
Stop reading past the end of
ivptr
arrayIf you have code like this:
x
andy
will shareiv_index_tbl
hashes. However, the size of thehash will grow larger than the number if entries in
ivptr
iny
.Before this commit,
rb_ivar_count
would use the size of the hash todetermine how far to read in to the array, but this means that it could
read past the end of the array and cause the program to segv
[ruby-core:78403]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e