зеркало из https://github.com/github/ruby.git
Add error globals to mark list so they don't move
JSON gem is referencing constants defined in Ruby then keeping a reference as a global. We need to register these globals so they stay pinned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
41f5237ed1
Коммит
e385c159da
|
@ -1344,6 +1344,8 @@ void Init_generator(void)
|
|||
|
||||
eGeneratorError = rb_path2class("JSON::GeneratorError");
|
||||
eNestingError = rb_path2class("JSON::NestingError");
|
||||
rb_gc_register_mark_object(eGeneratorError);
|
||||
rb_gc_register_mark_object(eNestingError);
|
||||
|
||||
cState = rb_define_class_under(mGenerator, "State", rb_cObject);
|
||||
rb_define_alloc_func(cState, cState_s_allocate);
|
||||
|
|
|
@ -2091,6 +2091,8 @@ void Init_parser(void)
|
|||
cParser = rb_define_class_under(mExt, "Parser", rb_cObject);
|
||||
eParserError = rb_path2class("JSON::ParserError");
|
||||
eNestingError = rb_path2class("JSON::NestingError");
|
||||
rb_gc_register_mark_object(eParserError);
|
||||
rb_gc_register_mark_object(eNestingError);
|
||||
rb_define_alloc_func(cParser, cJSON_parser_s_allocate);
|
||||
rb_define_method(cParser, "initialize", cParser_initialize, -1);
|
||||
rb_define_method(cParser, "parse", cParser_parse, 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче