summaryrefslogtreecommitdiff
path: root/ext/objspace/objspace_dump.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2023-10-11 11:30:10 -0700
committerJohn Hawthorn <john@hawthorn.email>2023-10-12 10:22:32 +0200
commit1c871c08d9dc9893968067de339abd0e05836d74 (patch)
tree295bf8decffd095331c572fe1814ca76db3b3c60 /ext/objspace/objspace_dump.c
parent635b92099e7ddd1b2eca065134efcfdc7ad7bab3 (diff)
Switch mid dump to dump_append_string_value
I don't think it's possible to create a CI with a mid which would need escaping to be in a JSON string, but I think we might as well not rely on that assumption.
Diffstat (limited to 'ext/objspace/objspace_dump.c')
-rw-r--r--ext/objspace/objspace_dump.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index 50dead5773..bcee5312fc 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -436,9 +436,8 @@ dump_object(VALUE obj, struct dump_config *dc)
case imemo_callinfo:
mid = vm_ci_mid((const struct rb_callinfo *)obj);
if (mid != 0) {
- dump_append(dc, ", \"mid\":\"");
- dump_append(dc, rb_id2name(mid));
- dump_append(dc, "\"");
+ dump_append(dc, ", \"mid\":");
+ dump_append_string_value(dc, rb_id2str(mid));
}
break;