diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-07 09:56:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-07 09:56:01 +0000 |
commit | 054dbe2a43c6c2183bd018a15724a59bb8fd48d3 (patch) | |
tree | 880dfb05e7d715675759380e9402fc4d5ad6df0a /test/ruby | |
parent | 3a5daefe1f3e7b55571febe2e50d736fa7bed82e (diff) | |
download | ruby-054dbe2a43c6c2183bd018a15724a59bb8fd48d3.tar.gz |
* vm.c (vm_set_top_stack, vm_set_eval_stack): check for stack
overflow with stack_max before push new frame. [ruby-core:41520]
[Bug #5720]
* vm.c (vm_set_main_stack): no stack overflow chances after
vm_set_eval_stack().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_exception.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 52dd4665a1..1d16da695c 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -328,4 +328,10 @@ end.join def test_errno assert_equal(Encoding.find("locale"), Errno::EINVAL.new.message.encoding) end + + def test_too_many_args_in_eval + bug5720 = '[ruby-core:41520]' + arg_string = (0...140000).to_a.join(", ") + assert_raise(SystemStackError, bug5720) {eval "raise(#{arg_string})"} + end end |