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
Родитель 8b4d2a5014
Коммит fc184ca1f7
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;