mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Additional experimental fix for r35261.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a4d3990f25
commit
e0ba59b708
3 changed files with 3 additions and 3 deletions
|
@ -92,9 +92,9 @@ static void fbuffer_append_str(FBuffer *fb, VALUE str)
|
||||||
const char *newstr = StringValuePtr(str);
|
const char *newstr = StringValuePtr(str);
|
||||||
unsigned long len = RSTRING_LEN(str);
|
unsigned long len = RSTRING_LEN(str);
|
||||||
|
|
||||||
RB_GC_GUARD(str);
|
|
||||||
|
|
||||||
fbuffer_append(fb, newstr, len);
|
fbuffer_append(fb, newstr, len);
|
||||||
|
|
||||||
|
RB_GC_GUARD(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fbuffer_append_char(FBuffer *fb, char newchr)
|
static void fbuffer_append_char(FBuffer *fb, char newchr)
|
||||||
|
|
|
@ -762,7 +762,6 @@ static void generate_json_bignum(FBuffer *buffer, VALUE Vstate, JSON_Generator_S
|
||||||
{
|
{
|
||||||
VALUE tmp = rb_funcall(obj, i_to_s, 0);
|
VALUE tmp = rb_funcall(obj, i_to_s, 0);
|
||||||
fbuffer_append_str(buffer, tmp);
|
fbuffer_append_str(buffer, tmp);
|
||||||
RB_GC_GUARD(tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
|
static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
|
||||||
|
|
|
@ -105,6 +105,7 @@ typedef struct JSON_Generator_StateStruct {
|
||||||
Data_Get_Struct(Vstate, JSON_Generator_State, state); \
|
Data_Get_Struct(Vstate, JSON_Generator_State, state); \
|
||||||
buffer = cState_prepare_buffer(Vstate); \
|
buffer = cState_prepare_buffer(Vstate); \
|
||||||
generate_json_##type(buffer, Vstate, state, self); \
|
generate_json_##type(buffer, Vstate, state, self); \
|
||||||
|
RB_GC_GUARD(Vstate); \
|
||||||
return fbuffer_to_s(buffer)
|
return fbuffer_to_s(buffer)
|
||||||
|
|
||||||
static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self);
|
static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self);
|
||||||
|
|
Loading…
Add table
Reference in a new issue