mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Check the length of proto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5434d73ef7
commit
2690939122
1 changed files with 2 additions and 0 deletions
|
@ -34,6 +34,8 @@ def mkfunc(rettype, fnum, argc)
|
|||
" proto = rb_ary_entry(obj, 0);",
|
||||
" proc = rb_ary_entry(obj, 1);",
|
||||
" Check_Type(proto, T_STRING);",
|
||||
" if( RSTRING(proto)->len >= #{argc.to_s} )",
|
||||
" rb_raise(rb_eArgError, \"too many arguments\");",
|
||||
" rb_dl_scan_callback_args(buff, RSTRING(proto)->ptr, &argc, argv);",
|
||||
" retval = rb_funcall2(proc, id_call, argc, argv);",
|
||||
"",
|
||||
|
|
Loading…
Add table
Reference in a new issue