* 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
This commit is contained in:
nobu 2005-08-08 13:14:08 +00:00
parent 875d51ffc9
commit 779f4383aa
2 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,11 @@
Mon Aug 8 22:13:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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]
Mon Aug 8 21:28:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> Mon Aug 8 21:28:13 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* test/ruby/test_fnmatch.rb: separated from test_file.rb. * test/ruby/test_fnmatch.rb: separated from test_file.rb.
@ -13,7 +21,7 @@ Mon Aug 8 01:26:37 2005 Mauricio Fernandez <mfp@acm.org>
Mon Aug 8 05:16:55 2005 GOTOU Yuuzou <gotoyuzo@notwork.org> Mon Aug 8 05:16:55 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl.c (ossl_raise): should use ERR_peek_last_error * ext/openssl/ossl.c (ossl_raise): should use ERR_peek_last_error
to get last error on the current thread. And should report to get last error on the current thread. And should report
if errors are on the stack while OpenSSL.debug is true. if errors are on the stack while OpenSSL.debug is true.
* ext/openssl/ossl.c (ossl_get_errors): new method for debugging * ext/openssl/ossl.c (ossl_get_errors): new method for debugging

9
eval.c
View File

@ -5269,6 +5269,13 @@ assign(self, lhs, val, pcall)
} }
break; break;
case NODE_BLOCK:
lhs = lhs->nd_head;
if (nd_type(lhs) == NODE_ARGS) {
formal_assign(self, lhs, 1, &val, 0);
break;
}
default: default:
rb_bug("bug in variable assignment"); rb_bug("bug in variable assignment");
break; break;
@ -9326,7 +9333,7 @@ rb_node_arity(body)
if (nd_type(body) == NODE_BLOCK) if (nd_type(body) == NODE_BLOCK)
body = body->nd_head; body = body->nd_head;
if (!body) return 0; 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) if (body->nd_opt || body->nd_rest)
n = -n-1; n = -n-1;
return n; return n;