mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 21:44:30 +02:00
re.c: check that MatchData is initialized
Follow r16757 ("* re.c: fix SEGV by Regexp.allocate.names, Match.allocate.names, etc.", 2008-06-02). Don't do null dereference if MatchData#hash or #== is called against an uninitialized instance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2a45604772
commit
d802149be3
2 changed files with 5 additions and 1 deletions
|
@ -946,6 +946,7 @@ class TestRegexp < Test::Unit::TestCase
|
|||
assert_raise(TypeError) { Regexp.allocate.names }
|
||||
assert_raise(TypeError) { Regexp.allocate.named_captures }
|
||||
|
||||
assert_raise(TypeError) { MatchData.allocate.hash }
|
||||
assert_raise(TypeError) { MatchData.allocate.regexp }
|
||||
assert_raise(TypeError) { MatchData.allocate.names }
|
||||
assert_raise(TypeError) { MatchData.allocate.size }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue