From: "luke-gru (Luke Gruber) via ruby-core" Date: 2026-06-12T18:38:51+00:00 Subject: [ruby-core:125730] [Ruby Bug#22103] Constant-folded /o regexp crashes with dupstring of a Regexp Issue #22103 has been updated by luke-gru (Luke Gruber). Backport [PR](https://github.com/ruby/ruby/pull/17306) ---------------------------------------- Bug #22103: Constant-folded /o regexp crashes with dupstring of a Regexp https://bugs.ruby-lang.org/issues/22103#change-117616 * Author: shugo (Shugo Maeda) * Status: Closed * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: REQUIRED ---------------------------------------- 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/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/