summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-12 11:10:22 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-12 11:10:22 +0000
commitead9b197be96f9eacf462b5539f71c43422495d0 (patch)
tree9b2965a14b6226ab54d0d2a8ad2a6f831454367f /eval.c
parent56b42dec015337f6a1a30aee1a6e6364ded3e468 (diff)
* parse.y (f_args): allow post mandatory arguments after optional
arguments. [ruby-dev:29014] * parse.y (new_args_gen): allow post_args without rest_args. * eval.c (formal_assign): ditto. * parse.y (new_args_gen): check post argument duplication. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index ad976f4c2e..acd1840be9 100644
--- a/eval.c
+++ b/eval.c
@@ -244,7 +244,7 @@ static void rb_f_END(void);
static struct BLOCK *passing_block(VALUE,struct BLOCK*);
static int block_orphan(struct BLOCK *data);
-static VALUE rb_cMethod;
+VALUE rb_cMethod;
static VALUE rb_cUnboundMethod;
static VALUE umethod_bind(VALUE, VALUE);
static VALUE rb_mod_define_method(int, VALUE*, VALUE);
@@ -5131,7 +5131,7 @@ assign(VALUE self, NODE *lhs, VALUE val, int pcall)
int cnt;
VALUE *p;
- if ((long)(lhs->nd_args) != -1) {
+ if (lhs->nd_args && (long)(lhs->nd_args) != -1) {
assign(self, lhs->nd_args, val, 0);
}
cnt = lhs->nd_head->nd_alen;
@@ -5660,7 +5660,7 @@ formal_assign(VALUE recv, NODE *node, int argc, const VALUE *argv, VALUE *local_
NODE *opt = node->nd_opt;
int ac = argc - npost;
- while (opt && ac) {
+ while (opt && ac > 0) {
assign(recv, opt->nd_head, *argv, 1);
argv++; ac--;
++i;
@@ -8372,7 +8372,7 @@ proc_s_new(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * proc { |...| block } => a_proc
+ * proc {|...| block } => a_proc
*
* Equivalent to <code>Proc.new</code>.
*/