aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2023-02-15 10:42:52 +0100
committerJean Boussier <jean.boussier@gmail.com>2023-02-15 15:24:22 +0100
commit7413079dae81e46aefc948cd8872497567945791 (patch)
tree31c1118b1bd5d751940571505ff5db1058d612e4 /eval.c
parentbac4d2eefa079168968841079727fe2289b6ab6e (diff)
downloadruby-7413079dae81e46aefc948cd8872497567945791.tar.gz
Encapsulate RCLASS_ATTACHED_OBJECT
Right now the attached object is stored as an instance variable and all the call sites that either get or set it have to know how it's stored. It's preferable to hide this implementation detail behind accessors so that it is easier to change how it's stored.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 4425dcf0c5..e7c2904df4 100644
--- a/eval.c
+++ b/eval.c
@@ -441,7 +441,7 @@ rb_class_modify_check(VALUE klass)
if (FL_TEST(klass, FL_SINGLETON)) {
desc = "object";
- klass = rb_ivar_get(klass, id__attached__);
+ klass = RCLASS_ATTACHED_OBJECT(klass);
if (!SPECIAL_CONST_P(klass)) {
switch (BUILTIN_TYPE(klass)) {
case T_MODULE: