aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/bug-11928.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-12 15:17:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-12 15:17:19 +0000
commit8ce9863dd9c6a3234e46d2645d1c2259d9ac62d1 (patch)
tree08d4aa626b0c886080c79361c9bc8504ed8eb8b7 /test/ruby/bug-11928.rb
parent9c771103325f29944c920a0f25102e9af63997ba (diff)
downloadruby-8ce9863dd9c6a3234e46d2645d1c2259d9ac62d1.tar.gz
iseq.c: mark parents of wrapped iseq
* iseq.c (iseqw_mark): as wrapped iseq is isolated from the call stack, it needs to take care of its parent and ancestors, so that they do not become orphans. [ruby-core:72620] [Bug #11928] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/bug-11928.rb')
-rw-r--r--test/ruby/bug-11928.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/bug-11928.rb b/test/ruby/bug-11928.rb
new file mode 100644
index 0000000000..72b3b0f8ed
--- /dev/null
+++ b/test/ruby/bug-11928.rb
@@ -0,0 +1,14 @@
+class Segfault
+ at_exit { Segfault.new.segfault }
+
+ define_method 'segfault' do
+ n = 11928
+ v = nil
+ i = 0
+ while i < n
+ i += 1
+ v = (foo rescue $!).local_variables
+ end
+ assert_equal(%i[i n v], v.sort)
+ end
+end