From fc184ca1f789ce6a89e83b9247b6bd172af7c659 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Sun, 6 Feb 2022 13:48:09 -0800 Subject: 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. --- memory_view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory_view.c b/memory_view.c index 637d427e86..935b8d983f 100644 --- a/memory_view.c +++ b/memory_view.c @@ -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; -- cgit v1.2.3