[PATCH] json/generator: prevent GC of temporary strings
ext/json/generator/generator.c: prevent GC of temporary strings
We need to guard temporary strings from being collected while we
append to the JSON buffer (which may allocate memory). The
RSTRING_PAIR macro is dangerous since it preserves no pointer to
the original string VALUE, allowing GC to reap the object while
we're still using the (C) string pointer.
The included test case shows data corruption with large
Bignums without this fix.
If you prefer git pull: git pull git://bogomips.org/ruby json-gc-guard