Issue #13054 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.1: UNKNOWN, 2.2: DONE, 2.3: REQUIRED to 2.1: UNKNOWN, 2.2: DONE, 2.3: DONE

ruby_2_3 r57569 merged revision(s) 57123.

----------------------------------------
Bug #13054: MatchData segfaults if RMatch::regexp is nil
https://bugs.ruby-lang.org/issues/13054#change-62902

* Author: Kazuki Yamaguchi
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.1: UNKNOWN, 2.2: DONE, 2.3: DONE
----------------------------------------
[Bug #10877] and [Bug #13042] didn't fix all of the issues.

The following four examples cause segfault for me:

~~~ruby
"abc".sub("a", ""); $~.hash
"abc".sub("a", ""); $~.names
"abc".sub("a", ""); $~.named_captures
"abc".sub("a", ""); m=$~; m.regexp; "abc".sub("a", ""); $~ == m
~~~



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>