Project

General

Profile

Bug #13042

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

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

Status:
Closed
Priority:
Normal
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

Associated revisions

Revision 7f4dc817
Added by nobu (Nobuyoshi Nakada) over 2 years ago

re.c: non-regexp name reference

  • re.c (rb_reg_regsub): other than regexp has no name references. [ruby-core:78686] [Bug #13042]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57098
Added by nobu (Nobuyoshi Nakada) over 2 years ago

re.c: non-regexp name reference

  • re.c (rb_reg_regsub): other than regexp has no name references. [ruby-core:78686] [Bug #13042]

Revision 57098
Added by nobu (Nobuyoshi Nakada) over 2 years ago

re.c: non-regexp name reference

  • re.c (rb_reg_regsub): other than regexp has no name references. [ruby-core:78686] [Bug #13042]

Revision 57098
Added by nobu (Nobuyoshi Nakada) over 2 years ago

re.c: non-regexp name reference

  • re.c (rb_reg_regsub): other than regexp has no name references. [ruby-core:78686] [Bug #13042]

Revision 57098
Added by nobu (Nobuyoshi Nakada) over 2 years ago

re.c: non-regexp name reference

  • re.c (rb_reg_regsub): other than regexp has no name references. [ruby-core:78686] [Bug #13042]

Revision ea83d7fd
Added by usa (Usaku NAKAMURA) about 2 years ago

merge revision(s) 57098: [Backport #13042]

re.c: non-regexp name reference

* re.c (rb_reg_regsub): other than regexp has no name references.

[ruby-core:78686] [Bug #13042]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@57218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57218
Added by usa (Usaku NAKAMURA) about 2 years ago

merge revision(s) 57098: [Backport #13042]

re.c: non-regexp name reference

* re.c (rb_reg_regsub): other than regexp has no name references.

[ruby-core:78686] [Bug #13042]

Revision f6e44a2a
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 57098: [Backport #13042]

re.c: non-regexp name reference

* re.c (rb_reg_regsub): other than regexp has no name references.

[ruby-core:78686] [Bug #13042]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57349
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 57098: [Backport #13042]

re.c: non-regexp name reference

* re.c (rb_reg_regsub): other than regexp has no name references.

[ruby-core:78686] [Bug #13042]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset r57098.


re.c: non-regexp name reference

  • re.c (rb_reg_regsub): other than regexp has no name references. [ruby-core:78686] [Bug #13042]

Updated by nagachika (Tomoyuki Chikanaga) over 2 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) about 2 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) about 2 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.

Also available in: Atom PDF