* proc.c (proc_to_s): used a variable before initialized.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-06-24 07:35:49 +00:00
parent 68e02f2c2c
commit d1bd418715
2 changed files with 14 additions and 10 deletions

View File

@ -1,3 +1,7 @@
Sun Jun 24 16:35:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* proc.c (proc_to_s): used a variable before initialized.
Sun Jun 24 16:05:45 2007 Koichi Sasada <ko1@atdot.net> Sun Jun 24 16:05:45 2007 Koichi Sasada <ko1@atdot.net>
* vm.c (callee_setup_arg): added. support correct post arg. * vm.c (callee_setup_arg): added. support correct post arg.

8
proc.c
View File

@ -542,10 +542,11 @@ proc_to_s(VALUE self)
rb_proc_t *proc; rb_proc_t *proc;
char *cname = rb_obj_classname(self); char *cname = rb_obj_classname(self);
rb_iseq_t *iseq; rb_iseq_t *iseq;
const char *is_lambda = proc->is_lambda ? " (lambda)" : ""; const char *is_lambda;
GetProcPtr(self, proc); GetProcPtr(self, proc);
iseq = proc->block.iseq; iseq = proc->block.iseq;
is_lambda = proc->is_lambda ? " (lambda)" : "";
if (RUBY_VM_NORMAL_ISEQ_P(iseq)) { if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
int line_no = 0; int line_no = 0;
@ -1164,8 +1165,6 @@ umethod_bind(VALUE method, VALUE recv)
int int
rb_node_arity(NODE* body) rb_node_arity(NODE* body)
{ {
int n;
switch (nd_type(body)) { switch (nd_type(body)) {
case NODE_CFUNC: case NODE_CFUNC:
if (body->nd_argc < 0) if (body->nd_argc < 0)
@ -1179,7 +1178,8 @@ rb_node_arity(NODE* body)
return 0; return 0;
case NODE_BMETHOD: case NODE_BMETHOD:
return rb_proc_arity(body->nd_cval); return rb_proc_arity(body->nd_cval);
case RUBY_VM_METHOD_NODE:{ case RUBY_VM_METHOD_NODE:
{
rb_iseq_t *iseq; rb_iseq_t *iseq;
GetISeqPtr((VALUE)body->nd_body, iseq); GetISeqPtr((VALUE)body->nd_body, iseq);
if (iseq->arg_rest == -1 && iseq->arg_opts == 0) { if (iseq->arg_rest == -1 && iseq->arg_opts == 0) {