summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 23:37:56 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 23:37:56 +0000
commitef039de5604582fbf87aea2dbc9a28697423aa51 (patch)
tree774f67291582e8617bedac082aebb36ac8b1439d /bootstraptest
parent85e24491a6f2df6c764a743940651448e8d487b0 (diff)
* vm.c (vm_make_env_each): work around to solve Bug #2729.
fixes: Bug #2729 a patch from Kazuki Tsujimoto <kazuki@callcc.net> This problem is caused by changing dfp (dynamic env pointer) from saved dfp. Saved dfp is pointed env in VM stack. However, the dfp can be moved because VM copies env from VM stack to the heap. At this copying, dfp was also changed. To solve this problem, I'll try to change throw mechanism (not save target dfp, but save target cfp). * bootstraptest/test_flow.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_flow.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb
index 02062755aa..100ad0a2f1 100644
--- a/bootstraptest/test_flow.rb
+++ b/bootstraptest/test_flow.rb
@@ -517,6 +517,19 @@ assert_equal %Q{ENSURE\n}, %q{
end
end
e = Bug2728.new
+}],
+ ['[ruby-core:28132]', %q{
+ class Bug2729
+ include Enumerable
+ def each
+ begin
+ yield :foo
+ ensure
+ proc {}.call
+ end
+ end
+ end
+ e = Bug2729.new
}]].each do |bug, src|
assert_equal "foo", src + %q{e.detect {true}}, bug
assert_equal "true", src + %q{e.any? {true}}, bug