From bf76445be2163c32fb57c1a152d5d066f6f787cd Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 23 Dec 2007 02:26:45 +0000 Subject: * string.c (sym_call): use exact argument array interface. [ruby-core:14279] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index bd71bc282..ebfd39c9b 100644 --- a/string.c +++ b/string.c @@ -5519,17 +5519,15 @@ sym_to_sym(VALUE sym) } static VALUE -sym_call(VALUE args, VALUE sym) +sym_call(VALUE args, VALUE sym, int argc, VALUE *argv) { VALUE obj; - if (RARRAY_LEN(args) < 1) { + if (argc < 1) { rb_raise(rb_eArgError, "no receiver given"); } - obj = RARRAY_PTR(args)[0]; - return rb_funcall3(obj, (ID)sym, - RARRAY_LEN(args) - 1, - RARRAY_PTR(args) + 1); + obj = argv[0]; + return rb_funcall3(obj, (ID)sym, argc - 1, argv + 1); } /* -- cgit