summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximillian Polhill <[email protected]>2024-11-25 14:29:55 -0500
committerJohn Hawthorn <[email protected]>2024-11-25 17:29:58 -0800
commit56fbf64a533d87c9029c60f2924372f0ba53bd4a ()
tree97aaa69d4c94d544e8996364f5fb3572e9284d77
parent36f67f6bbbacb242e2c9e8fbd6d07ac706287ba2 (diff)
Fix vm_objtostring optimization for Symbol
Co-authored-by: John Hawthorn <[email protected]>
Notes: Merged: https://.com/ruby/ruby/pull/12168
-rw-r--r--vm_insnhelper.c8
1 files changed, 7 insertions, 1 deletions
@@ -2339,6 +2339,12 @@ check_cfunc(const rb_callable_method_entry_t *me, cfunc_type func)
}
static inline int
vm_method_cfunc_is(const rb_iseq_t *iseq, CALL_DATA cd, VALUE recv, cfunc_type func)
{
VM_ASSERT(iseq != NULL);
@@ -6072,7 +6078,7 @@ vm_objtostring(const rb_iseq_t *iseq, VALUE recv, CALL_DATA cd)
switch (type) {
case T_SYMBOL:
- if (check_cfunc(vm_cc_cme(cc), rb_sym_to_s)) {
// rb_sym_to_s() allocates a mutable string, but since we are only
// going to use this string for interpolation, it's fine to use the
// frozen string.