diff options
author | Alan Wu <[email protected]> | 2020-11-12 13:19:41 -0500 |
---|---|---|
committer | Alan Wu <[email protected]> | 2020-11-13 11:46:08 -0500 |
commit | 782621054178c5518b76cd5a1ee3588daf69854f (patch) | |
tree | 57064782ffbf181103d8335d484cf72237603a63 /class.c | |
parent | 1bd98ee295ee339ce36def71d8b031bdb816dc80 (diff) |
Use rb_attr_get() for hidden ivar
rb_ivar_get() can issue an uninitialized ivar warning. We never want to
issue warnings about hidden ivars as they are not actionable for users.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3763
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1811,7 +1811,7 @@ singleton_class_of(VALUE obj) klass = RBASIC(obj)->klass; if (!(FL_TEST(klass, FL_SINGLETON) && - rb_ivar_get(klass, id_attached) == obj)) { + rb_attr_get(klass, id_attached) == obj)) { rb_serial_t serial = RCLASS_SERIAL(klass); klass = rb_make_metaclass(obj, klass); RCLASS_SERIAL(klass) = serial; @@ -1852,7 +1852,7 @@ rb_singleton_class_get(VALUE obj) } klass = RBASIC(obj)->klass; if (!FL_TEST(klass, FL_SINGLETON)) return Qnil; - if (rb_ivar_get(klass, id_attached) != obj) return Qnil; + if (rb_attr_get(klass, id_attached) != obj) return Qnil; return klass; } |