diff options
| author | John Hawthorn <john@hawthorn.email> | 2025-07-22 12:10:45 -0700 |
|---|---|---|
| committer | John Hawthorn <john@hawthorn.email> | 2025-07-28 09:44:47 -0700 |
| commit | 5ca71364ff6cf4a9c445cb2701b1eb4770e79579 (patch) | |
| tree | 60ea51eed1d321aecbe8b2828314e8935aa40fec /include/ruby/internal/intern | |
| parent | 7913aff2b34b64cf2bc5f0a638bb9ac5b9abdc53 (diff) | |
Avoid GC while operands in inconsistent state
compile_data_calloc2 may run GC (though because it allocates from an
arena this is rare in practice). When this happened when resizing
operands there was a risk of seeing the insn in an inconsistent state.
To solve this we need to make any allocations before we start modifying
the instrucitons. This refactors the code to use a new
insn_replace_with_operands() function that allocates the new operands
array before modifying the instruction object.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Diffstat (limited to 'include/ruby/internal/intern')
0 files changed, 0 insertions, 0 deletions
