diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2019-05-13 14:27:54 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-10-31 13:44:19 +0900 |
commit | 8ac832ad1c790f2119449af1754f6a80c4d917e7 (patch) | |
tree | 85909e422a26a1141431c9a95cd3932d5cf933ca | |
parent | b2f06973cddf37cf86c68c82391976358dc05e46 (diff) | |
download | json-8ac832ad1c790f2119449af1754f6a80c4d917e7.tar.gz |
Add NaN / Infinity / MinusInfinity to mark list
This prevents the constants from moving.
-rw-r--r-- | ext/json/ext/parser/parser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index 1fae9ca..0f98cf9 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -2097,8 +2097,13 @@ void Init_parser(void) rb_define_method(cParser, "source", cParser_source, 0); CNaN = rb_const_get(mJSON, rb_intern("NaN")); + rb_gc_register_mark_object(CNaN); + CInfinity = rb_const_get(mJSON, rb_intern("Infinity")); + rb_gc_register_mark_object(CInfinity); + CMinusInfinity = rb_const_get(mJSON, rb_intern("MinusInfinity")); + rb_gc_register_mark_object(CMinusInfinity); i_json_creatable_p = rb_intern("json_creatable?"); i_json_create = rb_intern("json_create"); |