diff options
author | Peter Zhu <[email protected]> | 2023-12-24 09:08:01 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-12-24 11:04:41 -0500 |
commit | f0efeddd41f96d3afae9af73a3dc594d86614f4b (patch) | |
tree | 0bbdeed0270ccd7789ebef569b50445c1608e0ea /complex.c | |
parent | 8ad8803bb4aed01dfe56e42dc7c131b6bf307655 (diff) |
Fix Regexp#inspect for GC compaction
rb_reg_desc was not safe for GC compaction because it took in the C
string and length but not the backing String object so it get moved
during compaction. This commit changes rb_reg_desc to use the string
from the Regexp object.
The test fails when RGENGC_CHECK_MODE is turned on:
TestRegexp#test_inspect_under_gc_compact_stress [test/ruby/test_regexp.rb:474]:
<"(?-mix:\\/)|"> expected but was
<"/\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00/">.
Diffstat (limited to 'complex.c')
0 files changed, 0 insertions, 0 deletions