summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-27 08:31:10 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-27 08:31:10 +0000
commit833551800d494276c1da7d1c471733c4ccd061b7 (patch)
treeb879fd853832d3d372e669bcb983edf6e8f132aa /enumerator.c
parent270ba8d81e79d18d212517cee9094670656706ff (diff)
downloadruby-833551800d494276c1da7d1c471733c4ccd061b7.tar.gz
* enumerator.c (enum_each_cons): move RETURN_ENUMERATOR() after
argument check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/enumerator.c b/enumerator.c
index fc156bf96e..3f176a77a9 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -195,8 +195,8 @@ enum_each_cons(VALUE obj, VALUE n)
long size = NUM2LONG(n);
VALUE args[2];
- RETURN_ENUMERATOR(obj, 1, &n);
if (size <= 0) rb_raise(rb_eArgError, "invalid size");
+ RETURN_ENUMERATOR(obj, 1, &n);
args[0] = rb_ary_new2(size);
args[1] = (VALUE)size;