11 Jun
2026
11 Jun
'26
10:37 a.m.
Issue #22103 has been updated by shugo (Shugo Maeda). I've opened a pull request at: https://github.com/ruby/ruby/pull/17274 ---------------------------------------- Bug #22103: Constant-folded /o regexp crashes with dupstring of a Regexp https://bugs.ruby-lang.org/issues/22103#change-117555 * Author: shugo (Shugo Maeda) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- A `/o` (once) regexp whose interpolation folds to a constant crashes at runtime: ```ruby def m; /#{"a"}/o; end m #=> [BUG] heap_idx_for_size: allocation size too large ``` A plain `/#{"a"}/` (no `/o`) is fine. -- https://bugs.ruby-lang.org/