1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

objspace_dump.c: Handle allocation path and line missing

This commit is contained in:
Jean Boussier 2021-01-15 18:18:58 +01:00 committed by Aaron Patterson
parent 383685b52b
commit 6ca3d1af33
Notes: git 2021-01-21 03:48:44 +09:00

View file

@ -471,10 +471,15 @@ dump_object(VALUE obj, struct dump_config *dc)
dump_append(dc, "]");
if (ainfo) {
dump_append(dc, ", \"file\":\"");
dump_append(dc, ainfo->path);
dump_append(dc, "\", \"line\":");
dump_append_lu(dc, ainfo->line);
if (ainfo->path) {
dump_append(dc, ", \"file\":\"");
dump_append(dc, ainfo->path);
dump_append(dc, "\"");
}
if (ainfo->line) {
dump_append(dc, ", \"line\":");
dump_append_lu(dc, ainfo->line);
}
if (RTEST(ainfo->mid)) {
VALUE m = rb_sym2str(ainfo->mid);
dump_append(dc, ", \"method\":");