diff options
author | John Hawthorn <john@hawthorn.email> | 2022-02-06 13:48:09 -0800 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2022-05-27 13:38:40 -0700 |
commit | fc184ca1f789ce6a89e83b9247b6bd172af7c659 (patch) | |
tree | 0ba0054dec1a76964b74f92efbd1d6c038f983aa /memory_view.c | |
parent | 8b4d2a50148b9944dd2d1d2d6ebe7b09874ddfdd (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5663
Diffstat (limited to 'memory_view.c')
-rw-r--r-- | memory_view.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |