Avoid using 'mrb_str_new_static` if a symbol is packed; fix #4342

parent 55986123
......@@ -325,6 +325,10 @@ mrb_sym_to_s(mrb_state *mrb, mrb_value sym)
mrb_int len;
p = mrb_sym2name_len(mrb, id, &len);
#ifndef MRB_ENABLE_SYMBOLL_ALL
if (p == mrb->symbuf)
return mrb_str_new(mrb, p, len);
#endif
return mrb_str_new_static(mrb, p, len);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment