diff --git a/ChangeLog b/ChangeLog index 4d65877830..d35c2c46df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Aug 25 16:05:50 2006 Nobuyoshi Nakada + + * object.c (sym_call): check if the receiver is given. + Wed Aug 23 00:25:14 2006 Nobuyoshi Nakada * lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to diff --git a/object.c b/object.c index d40d19efea..c8c39a3695 100644 --- a/object.c +++ b/object.c @@ -1057,8 +1057,12 @@ sym_to_sym(VALUE sym) static VALUE 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, RARRAY(args)->len - 1, RARRAY(args)->ptr + 1);