From: nagachika00@... Date: 2016-12-17T09:52:13+00:00 Subject: [ruby-core:78704] [Ruby trunk Bug#13042] gsub segfaults when the pattern is a matching string and the replacement has an unmatched named capture Issue #13042 has been updated by Tomoyuki Chikanaga. Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED ---------------------------------------- Bug #13042: gsub segfaults when the pattern is a matching string and the replacement has an unmatched named capture https://bugs.ruby-lang.org/issues/13042#change-62080 * Author: Hordur Freyr Yngvason * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16] * Backport: 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED ---------------------------------------- Ruby segfaults for all code of the form ~~~ ruby string.gsub(pattern, replacement) ~~~ where `pattern` is a substring of `string` (not a regex) and `replacement` includes a "named capture", such as `\k<>`. For example: ~~~ ruby 'hello'.gsub('hello', '\k') ~~~ ---Files-------------------------------- error (5.81 KB) test.rb (34 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: