зеркало из https://github.com/github/ruby.git
vm_method.c: check arity earlier
* vm_method.c (rb_add_method_cfunc, rb_add_method_cfunc_frameless): check arity earlier at definition time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
60f949e101
Коммит
6be52625b2
|
@ -1,3 +1,8 @@
|
|||
Thu Oct 18 16:44:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_method.c (rb_add_method_cfunc, rb_add_method_cfunc_frameless):
|
||||
check arity earlier at definition time.
|
||||
|
||||
Thu Oct 18 15:11:31 2012 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm_insnhelper.c: add `inline' keyword to several functions.
|
||||
|
|
|
@ -84,6 +84,7 @@ rb_define_notimplement_method_id(VALUE mod, ID id, rb_method_flag_t noex)
|
|||
void
|
||||
rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex)
|
||||
{
|
||||
if (argc < -2 || 15 < argc) rb_raise(rb_eArgError, "arity out of range: %d for -2..15", argc);
|
||||
if (func != rb_f_notimplement) {
|
||||
rb_method_cfunc_t opt;
|
||||
opt.func = func;
|
||||
|
@ -98,6 +99,7 @@ rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_me
|
|||
void
|
||||
rb_add_method_cfunc_frameless(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex)
|
||||
{
|
||||
if (argc < 0 || 1 < argc) rb_raise(rb_eArgError, "arity out of range: %d for 0..1", argc);
|
||||
if (func != rb_f_notimplement) {
|
||||
rb_method_cfunc_t opt;
|
||||
opt.func = func;
|
||||
|
|
Загрузка…
Ссылка в новой задаче