Project

General

Profile

« Previous | Next » 

Revision ab4c7077

Added by mame (Yusuke Endoh) over 2 years ago

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.

Fixes [Bug #19159]