mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* struct.c: accessing >10 member caused segmentation fault. [ruby-dev:26247]
* test/ruby/test_struct.rb: test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a9543d64f1
commit
3aa5496c98
3 changed files with 23 additions and 2 deletions
|
@ -21,4 +21,16 @@ class TestStruct < Test::Unit::TestCase
|
|||
test.bar = 47
|
||||
assert_equal(47, test.bar)
|
||||
end
|
||||
|
||||
# [ruby-dev:26247] more than 10 struct members causes segmentation fault
|
||||
def test_morethan10members
|
||||
list = %w( a b c d e f g h i j k l m n o p )
|
||||
until list.empty?
|
||||
c = Struct.new(* list.map {|ch| ch.intern }).new
|
||||
list.each do |ch|
|
||||
c.__send__(ch)
|
||||
end
|
||||
list.pop
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue