From 88101695ab516ce30f930513150c1247ebc6c36d Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 5 Feb 2013 06:04:59 +0000 Subject: * proc.c (rb_binding_new_with_cfp): permit to create binding object of IFUNC frame. When `rb_binding_new_with_cfp()' is called, VM finds out the first normal (has iseq) frame and create a binding object of this frame and create Env objects. `ep's of related frames are updated (`ep's point Env object managed spaces). However, `ep' of skipped IFUNC frame was not updated and old invalid `ep' was remained. It causes serious problems. To solve this issue, permit IFUNC to create binding. (Maybe there is no problem on it) [ruby-dev:46908] [ruby-trunk - Bug #7774] * test/ruby/test_settracefunc.rb: add a test. * vm.c (rb_vm_get_binding_creatable_next_cfp), vm_core.h: added. * vm_trace.c: fix to use `rb_vm_get_binding_creatable_next_cfp()'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_settracefunc.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index b0c6f2bcca..cfb06010ef 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -941,4 +941,22 @@ class TestSetTraceFunc < Test::Unit::TestCase end assert_security_error_safe4(func) end + + def test_trace_point_binding_in_ifunc + assert_normal_exit %q{ + tp = TracePoint.new(:raise) do |tp| + tp.binding + end + tp.enable do + obj = Object.new + class << obj + include Enumerable + def each + yield 1 + end + end + obj.zip({}) {} + end + }, '[ruby-dev:46908] [ruby-trunk - Bug #7774]' + end end -- cgit v1.2.3