Prevent segfault in String#scan with ObjectSpace.each_object
Calling String#scan without a block creates an incomplete MatchData
object whose RMATCH(match)->str is Qfalse. Usually this object is not
leaked, but it was possible to pull it by using ObjectSpace.each_object.
This change hides the internal MatchData object by using rb_obj_hide.
Prevent segfault in String#scan with ObjectSpace.each_object
Calling
String#scan
without a block creates an incomplete MatchDataobject whose
RMATCH(match)->str
is Qfalse. Usually this object is notleaked, but it was possible to pull it by using ObjectSpace.each_object.
This change hides the internal MatchData object by using rb_obj_hide.
Fixes [Bug #19159]