summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 23:27:35 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 23:27:35 +0000
commit382ed4285ae504c34a002536b922c0ca7cbd0a33 (patch)
tree9a1bc1144916ef28276df925b307f7515d874cbd /bootstraptest
parent7a3f54edb1656a7ad068c54e4084123beef2aafa (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/branches/ruby_1_9_3@33063 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