diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-08-25 07:06:15 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-08-25 07:06:15 +0000 |
| commit | 8fbe1c0d1b1684f26b204c4b6ae09bf26cec3343 (patch) | |
| tree | 638337014368e462b3159d458cfadd6fa5732504 | |
| parent | cb65426b5140afcc7d051baf88caaa8528cf5c72 (diff) | |
| download | ruby-8fbe1c0d1b1684f26b204c4b6ae09bf26cec3343.tar.gz ruby-8fbe1c0d1b1684f26b204c4b6ae09bf26cec3343.tar.xz ruby-8fbe1c0d1b1684f26b204c4b6ae09bf26cec3343.zip | |
* object.c (sym_call): check if the receiver is given.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | object.c | 6 |
2 files changed, 9 insertions, 1 deletions
@@ -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> * lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to @@ -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); |
