diff --git a/ChangeLog b/ChangeLog index c94482e1ab..af4cf71c94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Aug 8 22:13:48 2005 Nobuyoshi Nakada + + * 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 * test/ruby/test_fnmatch.rb: separated from test_file.rb. @@ -13,7 +21,7 @@ Mon Aug 8 01:26:37 2005 Mauricio Fernandez Mon Aug 8 05:16:55 2005 GOTOU Yuuzou * 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. * ext/openssl/ossl.c (ossl_get_errors): new method for debugging 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;