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:
parent
383685b52b
commit
6ca3d1af33
Notes:
git
2021-01-21 03:48:44 +09:00
1 changed files with 9 additions and 4 deletions
|
@ -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\":");
|
||||
|
|
Loading…
Reference in a new issue