diff options
-rw-r--r-- | compile.c | 3 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 1 |
2 files changed, 4 insertions, 0 deletions
@@ -5653,9 +5653,12 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp enum iseq_type parent_type; if (type == ISEQ_TYPE_TOP || type == ISEQ_TYPE_MAIN) { + LABEL *splabel = NEW_LABEL(line); + ADD_LABEL(ret, splabel); ADD_ADJUST(ret, line, 0); ADD_INSN(ret, line, putnil); ADD_INSN(ret, line, leave); + ADD_ADJUST_RESTORE(ret, splabel); } else if ((type == ISEQ_TYPE_RESCUE || type == ISEQ_TYPE_ENSURE) && parent_iseq && diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index c4d3d553be..5f0a236619 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -986,6 +986,7 @@ eom raise((return; "should not raise")) begin raise; ensure return; end; self begin raise; ensure return; end and self + nil&defined?0--begin e=no_method_error(); return; 0;end end; all_assertions(feature4840) do |a| code.each_line do |s| |