diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-19 13:52:03 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-19 13:52:03 +0000 |
commit | cb3e51e712717ca58c004cea31a5a998d78c6433 (patch) | |
tree | 542275fb503458ff1237869546394d317cafe592 | |
parent | f724560996316019d298c6ca0df2a8891bea2da3 (diff) | |
download | ruby-cb3e51e712717ca58c004cea31a5a998d78c6433.tar.gz |
* eval.c (rb_yield_0): should check args_args before lambda
argument check. [ruby-dev:29029]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | eval.c | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Wed Jul 19 19:40:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * eval.c (rb_yield_0): should check args_args before lambda + argument check. [ruby-dev:29029] + Tue Jul 18 23:53:59 2006 NAKAMURA Usaku <usa@ruby-lang.org> * process.c (rb_f_system): shouldn't block SIGCHLD if it's not @@ -4710,7 +4710,7 @@ rb_yield_0(VALUE val, VALUE self, VALUE klass /* OK */, int flags) int old_vmode; struct FRAME frame; NODE *cnode = ruby_current_node; - int ary_args = flags & YIELD_ARY_ARGS, lambda; + int ary_args, lambda; int state, broken = 0; rb_need_block(); @@ -4744,6 +4744,7 @@ rb_yield_0(VALUE val, VALUE self, VALUE klass /* OK */, int flags) node = block->body; var = block->var; lambda = block->flags & BLOCK_LAMBDA; + ary_args = flags & YIELD_ARY_ARGS; if (var) { PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { @@ -4819,7 +4820,7 @@ rb_yield_0(VALUE val, VALUE self, VALUE klass /* OK */, int flags) POP_TAG(); if (state) goto pop_state; } - else if (lambda && RARRAY(val)->len != 0 && + else if (lambda && ary_args && RARRAY(val)->len != 0 && (!node || nd_type(node) != NODE_IFUNC || node->nd_cfnc != bmcall)) { rb_raise(rb_eArgError, "wrong number of arguments (%ld for 0)", |