diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-06-01 15:03:09 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-06-01 15:03:09 +0000 |
commit | 3aa5496c9897b4aa284693da87bfa17e2e75aec8 (patch) | |
tree | 8b8ad99520b5a9bfb6fce64c49d5ddfd3405928f /test/ruby/test_struct.rb | |
parent | a9543d64f12e7003c143dca3084df6decc0485d9 (diff) | |
download | ruby-3aa5496c9897b4aa284693da87bfa17e2e75aec8.tar.gz |
* 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
Diffstat (limited to 'test/ruby/test_struct.rb')
-rw-r--r-- | test/ruby/test_struct.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb index fa1bb1549a..94a175420b 100644 --- a/test/ruby/test_struct.rb +++ b/test/ruby/test_struct.rb @@ -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 |