diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2025-10-25 10:31:04 +0200 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-10-25 08:57:48 +0000 |
| commit | 8e8e327870b23bcf263e0210472e6ee87d19c424 (patch) | |
| tree | 941363da38f9b4c7c6a24058151992990bb02873 /include/ruby | |
| parent | cb302881629f997f403e705425f69e5f6b0741ac (diff) | |
[ruby/json] Fix concurrent usage of JSON::Coder#dump
Fix: https://github.com/rails/rails/commit/90616277e3d8fc46c9cf35d6a7470ff1ea0092f7#r168784389
Because the `depth` counter is inside `JSON::State` it can't be used
concurrently, and in case of a circular reference the counter may be
left at the max value.
The depth counter should be moved outside `JSON_Generator_State` and
into `struct generate_json_data`, but it's a larger refactor.
In the meantime, `JSON::Coder` calls `State#generate_new` so I changed
that method so that it first copy the state on the stack.
https://github.com/ruby/json/commit/aefa671eca
Diffstat (limited to 'include/ruby')
0 files changed, 0 insertions, 0 deletions
