@@ -687,6 +687,11 @@ static void vstate_spill(struct generate_json_data *data)
687
687
MEMCPY (state , data -> state , JSON_Generator_State , 1 );
688
688
data -> state = state ;
689
689
data -> vstate = vstate ;
690
+ RB_OBJ_WRITTEN (vstate , Qundef , state -> indent );
691
+ RB_OBJ_WRITTEN (vstate , Qundef , state -> space );
692
+ RB_OBJ_WRITTEN (vstate , Qundef , state -> space_before );
693
+ RB_OBJ_WRITTEN (vstate , Qundef , state -> object_nl );
694
+ RB_OBJ_WRITTEN (vstate , Qundef , state -> array_nl );
690
695
}
691
696
692
697
static inline VALUE vstate_get (struct generate_json_data * data )
@@ -1122,7 +1127,7 @@ static VALUE string_config(VALUE config)
1122
1127
static VALUE cState_indent_set (VALUE self , VALUE indent )
1123
1128
{
1124
1129
GET_STATE (self );
1125
- state -> indent = string_config (indent );
1130
+ RB_OBJ_WRITE ( self , & state -> indent , string_config (indent ) );
1126
1131
return Qnil ;
1127
1132
}
1128
1133
@@ -1147,7 +1152,7 @@ static VALUE cState_space(VALUE self)
1147
1152
static VALUE cState_space_set (VALUE self , VALUE space )
1148
1153
{
1149
1154
GET_STATE (self );
1150
- state -> space = string_config (space );
1155
+ RB_OBJ_WRITE ( self , & state -> space , string_config (space ) );
1151
1156
return Qnil ;
1152
1157
}
1153
1158
@@ -1170,7 +1175,7 @@ static VALUE cState_space_before(VALUE self)
1170
1175
static VALUE cState_space_before_set (VALUE self , VALUE space_before )
1171
1176
{
1172
1177
GET_STATE (self );
1173
- state -> space_before = string_config (space_before );
1178
+ RB_OBJ_WRITE ( self , & state -> space_before , string_config (space_before ) );
1174
1179
return Qnil ;
1175
1180
}
1176
1181
@@ -1195,7 +1200,7 @@ static VALUE cState_object_nl(VALUE self)
1195
1200
static VALUE cState_object_nl_set (VALUE self , VALUE object_nl )
1196
1201
{
1197
1202
GET_STATE (self );
1198
- state -> object_nl = string_config (object_nl );
1203
+ RB_OBJ_WRITE ( self , & state -> object_nl , string_config (object_nl ) );
1199
1204
return Qnil ;
1200
1205
}
1201
1206
@@ -1218,7 +1223,7 @@ static VALUE cState_array_nl(VALUE self)
1218
1223
static VALUE cState_array_nl_set (VALUE self , VALUE array_nl )
1219
1224
{
1220
1225
GET_STATE (self );
1221
- state -> array_nl = string_config (array_nl );
1226
+ RB_OBJ_WRITE ( self , & state -> array_nl , string_config (array_nl ) );
1222
1227
return Qnil ;
1223
1228
}
1224
1229
0 commit comments