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

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Open to Closed

Applied in changeset r57098.


re.c: non-regexp name reference

Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED

Updated by usa (Usaku NAKAMURA) over 7 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: UNKNOWN, 2.2: DONE, 2.3: REQUIRED

ruby_2_2 r57218 merged revision(s) 57098.

Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: DONE, 2.3: REQUIRED to 2.1: UNKNOWN, 2.2: DONE, 2.3: DONE

ruby_2_3 r57349 merged revision(s) 57098.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0