summaryrefslogtreecommitdiff
path: root/ext/json/generator
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-09 21:13:32 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-09 21:13:32 +0000
commite385c159da9338b14ab7fb67ce8d8398ab069d5a (patch)
treeb999b23b44f95e50467aa8e6a6e96f1b51f45cab /ext/json/generator
parent41f5237ed19d5e8d471d441e2cbfc3063f58b110 (diff)
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
Diffstat (limited to 'ext/json/generator')
-rw-r--r--ext/json/generator/generator.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index 6b3cdd7e580..e59a1200084 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -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);