Project

General

Profile

Actions

Bug #13042

closed

gsub segfaults when the pattern is a matching string and the replacement has an unmatched named capture

Added by vindvaki (Hordur Freyr Yngvason) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
[ruby-core:78686]

Description

Ruby segfaults for all code of the form

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:

'hello'.gsub('hello', '\k<oops>')

Files

error (5.81 KB) error error output from running `ruby test.rb` vindvaki (Hordur Freyr Yngvason), 12/16/2016 07:25 PM
test.rb (34 Bytes) test.rb one liner bug reproduction vindvaki (Hordur Freyr Yngvason), 12/16/2016 07:27 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0