* object.c (sym_call): check if the receiver is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
319d2b185b
commit
2e61b69722
@ -1,3 +1,7 @@
|
|||||||
|
Fri Aug 25 16:05:50 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* object.c (sym_call): check if the receiver is given.
|
||||||
|
|
||||||
Wed Aug 23 00:25:14 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Aug 23 00:25:14 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to
|
* lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to
|
||||||
|
6
object.c
6
object.c
@ -1057,8 +1057,12 @@ sym_to_sym(VALUE sym)
|
|||||||
static VALUE
|
static VALUE
|
||||||
sym_call(VALUE args, VALUE sym)
|
sym_call(VALUE args, VALUE sym)
|
||||||
{
|
{
|
||||||
VALUE obj = RARRAY(args)->ptr[0];
|
VALUE obj;
|
||||||
|
|
||||||
|
if (RARRAY(args)->len < 1) {
|
||||||
|
rb_raise(rb_eArgError, "no receiver given");
|
||||||
|
}
|
||||||
|
obj = RARRAY(args)->ptr[0];
|
||||||
return rb_funcall3(obj, (ID)sym,
|
return rb_funcall3(obj, (ID)sym,
|
||||||
RARRAY(args)->len - 1,
|
RARRAY(args)->len - 1,
|
||||||
RARRAY(args)->ptr + 1);
|
RARRAY(args)->ptr + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user