diff options
author | Jean Boussier <byroot@ruby-lang.org> | 2023-02-15 10:42:52 +0100 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2023-02-15 15:24:22 +0100 |
commit | 7413079dae81e46aefc948cd8872497567945791 (patch) | |
tree | 31c1118b1bd5d751940571505ff5db1058d612e4 /vm_trace.c | |
parent | bac4d2eefa079168968841079727fe2289b6ab6e (diff) | |
download | ruby-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 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vm_trace.c b/vm_trace.c index 428c4a0170..9bb5e78b3d 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -23,6 +23,7 @@ #include "eval_intern.h" #include "internal.h" +#include "internal/class.h" #include "internal/hash.h" #include "internal/symbol.h" #include "iseq.h" @@ -724,7 +725,7 @@ call_trace_func(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klas klass = RBASIC(klass)->klass; } else if (FL_TEST(klass, FL_SINGLETON)) { - klass = rb_ivar_get(klass, id__attached__); + klass = RCLASS_ATTACHED_OBJECT(klass); } } |