1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (reduce_nodes_gen): NODE_RETURN in rescue body must not be

reduced when there is an else clause.  This caused bizarre behavior
  in [Bug #4473] [ruby-core:35629] [ruby-core:37884].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2011-07-10 02:42:07 +00:00
parent d22e08f937
commit b0f115da1a
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Sun Jul 10 11:35:29 2011 Yusuke Endoh <mame@tsg.ne.jp>
* parse.y (reduce_nodes_gen): NODE_RETURN in rescue body must not be
reduced when there is an else clause. This caused bizarre behavior
in [Bug #4473] [ruby-core:35629] [ruby-core:37884].
Sun Jul 10 09:46:14 2011 Masaya Tarui <tarui@ruby-lnag.org> Sun Jul 10 09:46:14 2011 Masaya Tarui <tarui@ruby-lnag.org>
* range.c (range_max): fix behavior with excluded end value. * range.c (range_max): fix behavior with excluded end value.

View file

@ -8713,6 +8713,10 @@ reduce_nodes_gen(struct parser_params *parser, NODE **body)
if (!subnodes(nd_head, nd_resq)) goto end; if (!subnodes(nd_head, nd_resq)) goto end;
break; break;
case NODE_RESCUE: case NODE_RESCUE:
if (node->nd_else) {
body = &node->nd_resq;
break;
}
if (!subnodes(nd_head, nd_resq)) goto end; if (!subnodes(nd_head, nd_resq)) goto end;
break; break;
default: default: