diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-24 07:35:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-24 07:35:49 +0000 |
commit | d1bd418715091794dc207198a0fe4152b5f40cb1 (patch) | |
tree | 5439f6003f868cf405a886f695cf726e4e4ff1a5 | |
parent | 68e02f2c2cc98e6ab736b3122aafe7a2398642f6 (diff) | |
download | ruby-d1bd418715091794dc207198a0fe4152b5f40cb1.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | proc.c | 20 |
2 files changed, 14 insertions, 10 deletions
@@ -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> * vm.c (callee_setup_arg): added. support correct post arg. @@ -542,10 +542,11 @@ proc_to_s(VALUE self) rb_proc_t *proc; char *cname = rb_obj_classname(self); rb_iseq_t *iseq; - const char *is_lambda = proc->is_lambda ? " (lambda)" : ""; + const char *is_lambda; GetProcPtr(self, proc); iseq = proc->block.iseq; + is_lambda = proc->is_lambda ? " (lambda)" : ""; if (RUBY_VM_NORMAL_ISEQ_P(iseq)) { int line_no = 0; @@ -1164,22 +1165,21 @@ umethod_bind(VALUE method, VALUE recv) int rb_node_arity(NODE* body) { - int n; - switch (nd_type(body)) { - case NODE_CFUNC: + case NODE_CFUNC: if (body->nd_argc < 0) return -1; return body->nd_argc; - case NODE_ZSUPER: + case NODE_ZSUPER: return -1; - case NODE_ATTRSET: + case NODE_ATTRSET: return 1; - case NODE_IVAR: + case NODE_IVAR: return 0; - case NODE_BMETHOD: + case NODE_BMETHOD: return rb_proc_arity(body->nd_cval); - case RUBY_VM_METHOD_NODE:{ + case RUBY_VM_METHOD_NODE: + { rb_iseq_t *iseq; GetISeqPtr((VALUE)body->nd_body, iseq); if (iseq->arg_rest == -1 && iseq->arg_opts == 0) { @@ -1189,7 +1189,7 @@ rb_node_arity(NODE* body) return -(iseq->argc + 1 + iseq->arg_post_len); } } - default: + default: rb_raise(rb_eArgError, "invalid node 0x%x", nd_type(body)); } } |