mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/objspace/objspace_dump.c(dump_object): Return empty JSON object when
passed object is a special const, instead of SEGV. Based patch by Kohei Suzuki (eagletmt). [ruby-core:69692] [Bug #11291] * test/objspace/test_objspace.rb(test_dump_special_consts): Test for above fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a2e4c41829
commit
cc77375d2d
3 changed files with 23 additions and 0 deletions
|
@ -149,6 +149,11 @@ dump_object(VALUE obj, struct dump_config *dc)
|
|||
ID flags[RB_OBJ_GC_FLAGS_MAX];
|
||||
size_t n, i;
|
||||
|
||||
if (SPECIAL_CONST_P(obj)) {
|
||||
dump_append(dc, "{}");
|
||||
return;
|
||||
}
|
||||
|
||||
dc->cur_obj = obj;
|
||||
dc->cur_obj_references = 0;
|
||||
dc->cur_obj_klass = BUILTIN_TYPE(obj) == T_NODE ? 0 : RBASIC_CLASS(obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue