Bug #10877
closed
String#sub causes segfault
Added by tonytonyjan (Weihang Jian) almost 10 years ago.
Updated over 9 years ago.
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
- 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"]
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r49675.
re.c: RMatch::regexp can be nil
- 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
Like0
Like0Like0Like0