mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
41f5237ed1
commit
e385c159da
2 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue