Issue #10877 has been updated by Yui NARUSE.

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.

----------------------------------------
Bug #10877: String#sub causes segfault
https://bugs.ruby-lang.org/issues/10877#change-51594

* Author: Wei-Hang Jian
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 2.2.0
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
----------------------------------------
~~~ruby
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)


-- 
https://bugs.ruby-lang.org/