Skip to content

Commit

Permalink
Only check class ancestors for ivar in memory_view
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhawthorn committed May 27, 2022
1 parent 8b4d2a5 commit fc184ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion memory_view.c
Expand Up @@ -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;
Expand Down

0 comments on commit fc184ca

Please sign in to comment.