Project

General

Profile

Actions

Bug #10877

closed

String#sub causes segfault

Added by tonytonyjan (Weihang Jian) about 9 years ago. Updated about 9 years ago.

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

Updated by nobu (Nobuyoshi Nakada) about 9 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"]
Actions #2

Updated by nobu (Nobuyoshi Nakada) about 9 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) about 9 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0