diff --git a/compile.c b/compile.c index 95d0e5f891..0c966a7b4b 100644 --- a/compile.c +++ b/compile.c @@ -5367,7 +5367,6 @@ compile_return(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, /* plain top-level, leave directly */ type = ISEQ_TYPE_METHOD; } - retval = 0; break; default: break; diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 5582c70556..aa82f52987 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1006,6 +1006,7 @@ eom begin raise; ensure return; end; self begin raise; ensure return; end and self nil&defined?0--begin e=no_method_error(); return; 0;end + return puts('ignored') #=> ignored end; .split(/\n/).map {|s|[(line+=1), *s.split(/#=> /, 2)]} failed = proc do |n, s|