diff options
author | Jean Boussier <[email protected]> | 2024-10-31 11:40:05 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-11-01 13:04:24 +0900 |
commit | b85a7a44fa05da4078c8b0e20445947d8551788d () | |
tree | 760fc7b92767b89db7ce11b72a9ff405c8d85c40 /ext/json/generator | |
parent | ef5565f5d17c5c8a0557637cf40e5124b0eebb5c (diff) |
[ruby/json] Trigger write barrier when setting Generator::State configs
Followup: https://.com/ruby/json/commit/6382c231b0b8 https://.com/ruby/json/commit/0c797b4a11
-rw-r--r-- | ext/json/generator/generator.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -687,6 +687,11 @@ static void vstate_spill(struct generate_json_data *data) MEMCPY(state, data->state, JSON_Generator_State, 1); data->state = state; data->vstate = vstate; } static inline VALUE vstate_get(struct generate_json_data *data) @@ -1122,7 +1127,7 @@ static VALUE string_config(VALUE config) static VALUE cState_indent_set(VALUE self, VALUE indent) { GET_STATE(self); - state->indent = string_config(indent); return Qnil; } @@ -1147,7 +1152,7 @@ static VALUE cState_space(VALUE self) static VALUE cState_space_set(VALUE self, VALUE space) { GET_STATE(self); - state->space = string_config(space); return Qnil; } @@ -1170,7 +1175,7 @@ static VALUE cState_space_before(VALUE self) static VALUE cState_space_before_set(VALUE self, VALUE space_before) { GET_STATE(self); - state->space_before = string_config(space_before); return Qnil; } @@ -1195,7 +1200,7 @@ static VALUE cState_object_nl(VALUE self) static VALUE cState_object_nl_set(VALUE self, VALUE object_nl) { GET_STATE(self); - state->object_nl = string_config(object_nl); return Qnil; } @@ -1218,7 +1223,7 @@ static VALUE cState_array_nl(VALUE self) static VALUE cState_array_nl_set(VALUE self, VALUE array_nl) { GET_STATE(self); - state->array_nl = string_config(array_nl); return Qnil; } |