Issue #13042 has been reported by Hordur Freyr Yngvason.

----------------------------------------
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

* Author: Hordur Freyr Yngvason
* Status: Open
* 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: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
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<oops>')
~~~

---Files--------------------------------
error (5.81 KB)
test.rb (34 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>