* vm.c (rb_vm_stack_to_heap): call rb_vm_get_binding_creatable_next_cfp

instead of rb_vm_get_ruby_level_next_cfp to prevent a segfault by
  calling Kernel#callcc. See r39067 for more details.
  [ruby-dev:46908] [ruby-trunk - Bug #7774]

* test/ruby/test_settracefunc.rb: add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ktsj 2013-02-05 15:55:41 +00:00
parent 81f9052c11
commit ca016c705f
3 changed files with 24 additions and 4 deletions

View file

@ -943,7 +943,8 @@ class TestSetTraceFunc < Test::Unit::TestCase
end
def test_trace_point_binding_in_ifunc
assert_normal_exit %q{
bug7774 = '[ruby-dev:46908]'
src = %q{
tp = TracePoint.new(:raise) do |tp|
tp.binding
end
@ -955,8 +956,18 @@ class TestSetTraceFunc < Test::Unit::TestCase
yield 1
end
end
obj.zip({}) {}
%s
end
}, '[ruby-dev:46908] [ruby-trunk - Bug #7774]'
}
assert_normal_exit src % %q{obj.zip({}) {}}, bug7774
assert_normal_exit src % %q{
require 'continuation'
begin
c = nil
obj.sort_by {|x| callcc {|c2| c ||= c2 }; x }
c.call
rescue RuntimeError
end
}, bug7774
end
end