summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-14 21:10:34 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-14 21:10:34 +0000
commit7316302483182a73136b00ad368585e551cbd86f (patch)
treed32188711001581a5e7e21d6669f6c4e91fcb497 /re.c
parent35c356ea72094dbbf1397d8f5acd065bd23d1177 (diff)
* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/re.c b/re.c
index 38a40771aa..e24050cfab 100644
--- a/re.c
+++ b/re.c
@@ -2904,9 +2904,7 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
const char *ptr;
long len;
- if (argc == 0 || argc > 3) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..3)", argc);
- }
+ rb_check_arity(argc, 1, 3);
if (TYPE(argv[0]) == T_REGEXP) {
VALUE re = argv[0];