summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-28 13:55:17 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-28 13:55:17 +0000
commite84f80761840000dd84ecd30d97946832e44dd97 (patch)
tree09906d81a9bf245b99900330eff8043d1fd78534 /test
parent29eae8b1e9a5142b30250d0a9cc738b4ce94eadc (diff)
merge revision(s) 64799,64800,64801: [Backport #15105]
fix typo. * vm_exec.h (DEBUG_END_INSN()): use `ec` instead of `th`. This macro is used when `VMDEBUG > 0`. escape all env properly. * vm_backtrace.c (rb_debug_inspector_open): escape all env using `rb_vm_stack_to_heap()` before making bindings. [Bug #15105] There is a complicated story of this issue: Without this patch, IFUNC frame does not escaped. A IFUNC frame points to CFUNC ep as previous ep. However, CFUNC ep can be escaped because of making bindings of Ruby level frames. IFUNC's ep can points to invalidated ep and `rb_iter_break()` will fail. This is why `any?` fails. * test/-ext-/debug/test_debug.rb: add a test. * remove trailing spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@66074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/debug/test_debug.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/-ext-/debug/test_debug.rb b/test/-ext-/debug/test_debug.rb
index 3804714d0d..bc41c1bb79 100644
--- a/test/-ext-/debug/test_debug.rb
+++ b/test/-ext-/debug/test_debug.rb
@@ -56,4 +56,20 @@ class TestDebug < Test::Unit::TestCase
binds = inspector_in_eval
binds_check binds, bug7635
end
+
+ class MyRelation
+ include Enumerable
+
+ def each
+ yield :each_entry
+ end
+ end
+
+ def test_lazy_block
+ x = MyRelation.new.any? do
+ Bug::Debug.inspector
+ true
+ end
+ assert_equal true, x, '[Bug #15105]'
+ end
end