Project

General

Profile

Bug #10877

String#sub causes segfault

Added by tonytonyjan (Wei-Hang Jian) almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:68209]

Description

str = 'abc'
reg = /(?<foo>a)bc/
str =~ reg
$~['foo'].sub 'a', ''
$~['foo']
tmp.rb:5: [BUG] Segmentation fault at 0x00000000000020

Abort trap: 6

Files

bug-10877.log (3.92 KB) bug-10877.log nobu (Nobuyoshi Nakada), 02/21/2015 10:51 AM

Associated revisions

Revision 2d12151a
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

re.c: RMatch::regexp can be nil

  • re.c (match_aref): RMatch::regexp is Qnil after matching by a string since r45451. [ruby-core:68209] [Bug #10877]

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

Revision 49675
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

re.c: RMatch::regexp can be nil

  • re.c (match_aref): RMatch::regexp is Qnil after matching by a string since r45451. [ruby-core:68209] [Bug #10877]

Revision 49675
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

re.c: RMatch::regexp can be nil

  • re.c (match_aref): RMatch::regexp is Qnil after matching by a string since r45451. [ruby-core:68209] [Bug #10877]

Revision 49675
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

re.c: RMatch::regexp can be nil

  • re.c (match_aref): RMatch::regexp is Qnil after matching by a string since r45451. [ruby-core:68209] [Bug #10877]

Revision 49675
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

re.c: RMatch::regexp can be nil

  • re.c (match_aref): RMatch::regexp is Qnil after matching by a string since r45451. [ruby-core:68209] [Bug #10877]

Revision 49675
Added by nobu (Nobuyoshi Nakada) almost 5 years ago

re.c: RMatch::regexp can be nil

  • re.c (match_aref): RMatch::regexp is Qnil after matching by a string since r45451. [ruby-core:68209] [Bug #10877]

Revision 17506700
Added by naruse (Yui NARUSE) almost 5 years ago

merge revision(s) 49675:

    * re.c (match_aref): RMatch::regexp is Qnil after matching by a
      string since r45451.  [ruby-core:68209] [Bug #10877]

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

Revision 49690
Added by naruse (Yui NARUSE) almost 5 years ago

merge revision(s) 49675:

* re.c (match_aref): RMatch::regexp is Qnil after matching by a
  string since r45451.  [ruby-core:68209] [Bug #10877]

History

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

  • File bug-10877.log bug-10877.log added
  • Description updated (diff)
  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED

Shorter code:

"a".sub("a", "")
$~["foo"]
#2

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r49675.


re.c: RMatch::regexp can be nil

  • re.c (match_aref): RMatch::regexp is Qnil after matching by a string since r45451. [ruby-core:68209] [Bug #10877]

Updated by naruse (Yui NARUSE) almost 5 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE

ruby_2_2 r49690 merged revision(s) 49675.

Also available in: Atom PDF