aboutsummaryrefslogtreecommitdiffstats
path: root/vm_eval.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2023-10-26 17:03:17 -0700
committerJeremy Evans <code@jeremyevans.net>2023-12-07 10:29:33 -0800
commit3081c83169c55ef7eead6222e49248e09232c22c (patch)
tree6825cd4cd747f053b4d085801a888d9217ee1726 /vm_eval.c
parent1721bb9dc6dcc3ecec05e9d6f72654099460ef50 (diff)
downloadruby-3081c83169c55ef7eead6222e49248e09232c22c.tar.gz
Support tracing of struct member accessor methods
This follows the same approach used for attr_reader/attr_writer in 2d98593bf54a37397c6e4886ccc7e3654c2eaf85, skipping the checking for tracing after the first call using the call cache, and clearing the call cache when tracing is turned on/off. Fixes [Bug #18886]
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/vm_eval.c b/vm_eval.c
index a1336cf17a..937f0582c4 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -299,11 +299,15 @@ vm_call0_body(rb_execution_context_t *ec, struct rb_calling_info *calling, const
}
case OPTIMIZED_METHOD_TYPE_STRUCT_AREF:
vm_call_check_arity(calling, 0, argv);
- ret = vm_call_opt_struct_aref0(ec, calling);
+ VM_CALL_METHOD_ATTR(ret,
+ vm_call_opt_struct_aref0(ec, calling),
+ (void)0);
goto success;
case OPTIMIZED_METHOD_TYPE_STRUCT_ASET:
vm_call_check_arity(calling, 1, argv);
- ret = vm_call_opt_struct_aset0(ec, calling, argv[0]);
+ VM_CALL_METHOD_ATTR(ret,
+ vm_call_opt_struct_aset0(ec, calling, argv[0]),
+ (void)0);
goto success;
default:
rb_bug("vm_call0: unsupported optimized method type (%d)", vm_cc_cme(cc)->def->body.optimized.type);