From 340390093b1db331630d227edbd0f32d2d2b882a Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 18 Nov 2013 13:47:56 +0000 Subject: eval_intern.h: refine stack overflow detection * eval_intern.h (TH_PUSH_TAG, TH_EXEC_TAG): refine stack overflow detection. chain local tag after setjmp() successed on it, because calling setjmp() also can overflow the stack. [ruby-dev:47804] [Bug #9109] * vm_eval.c (rb_catch_obj): now th->tag points previous tag until TH_EXEC_TAG(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_exception.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby/test_exception.rb') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 92438ad742..ca6e43ee13 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -477,6 +477,14 @@ end.join assert_raise(SystemStackError){m} end + def test_machine_stackoverflow + bug9109 = '[ruby-dev:47804] [Bug #9109]' + assert_separately([], <<-SRC) + h = {a: ->{h[:a].call}} + assert_raise(SystemStackError, #{bug9109.dump}) {h[:a].call} + SRC + end + def test_cause msg = "[Feature #8257]" cause = nil -- cgit v1.2.3