1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Only check class ancestors for ivar in memory_view

rb_class_get_superclass returns the immediate SUPER, including T_ICLASS.
rb_ivar_lookup isn't implemented for T_ICLASS so it uses the default
behaviour, which always returns Qnil.

This commit avoids checking T_ICLASS for ivars.
This commit is contained in:
John Hawthorn 2022-02-06 13:48:09 -08:00
parent 8b4d2a5014
commit fc184ca1f7
Notes: git 2022-05-28 05:39:05 +09:00

View file

@ -784,7 +784,7 @@ lookup_memory_view_entry(VALUE klass)
{
VALUE entry_obj = rb_ivar_lookup(klass, id_memory_view, Qnil);
while (NIL_P(entry_obj)) {
klass = rb_class_get_superclass(klass);
klass = rb_class_superclass(klass);
if (klass == rb_cBasicObject || klass == rb_cObject)
return NULL;