summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-08 13:14:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-08 13:14:08 +0000
commit779f4383aa26f6ae5812a723effe27e5387fe2fd (patch)
treecf3d89ca1ac625c0f90cd5920eb1f00a43fa4e8e /eval.c
parent875d51ffc93f3404f6b37134dd39b5ad698f6472 (diff)
* eval.c (assign): deal with new block argument.
fixed: [ruby-core:05536] * eval.c (rb_node_arity): follow change of NODE_ARGS. fixed: [ruby-dev:26761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 7ad94f1e6b..01dde5fe5f 100644
--- a/eval.c
+++ b/eval.c
@@ -5269,6 +5269,13 @@ assign(self, lhs, val, pcall)
}
break;
+ case NODE_BLOCK:
+ lhs = lhs->nd_head;
+ if (nd_type(lhs) == NODE_ARGS) {
+ formal_assign(self, lhs, 1, &val, 0);
+ break;
+ }
+
default:
rb_bug("bug in variable assignment");
break;
@@ -9326,7 +9333,7 @@ rb_node_arity(body)
if (nd_type(body) == NODE_BLOCK)
body = body->nd_head;
if (!body) return 0;
- n = body->nd_cnt;
+ n = body->nd_frml ? RARRAY(body->nd_frml)->len : 0;
if (body->nd_opt || body->nd_rest)
n = -n-1;
return n;