Actions
Bug #10877
closedString#sub causes segfault
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
Updated by nobu (Nobuyoshi Nakada) almost 10 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"]
Updated by nobu (Nobuyoshi Nakada) almost 10 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) over 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
Like0
Like0Like0Like0