1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

error.c: ArgumentError if no receiver

* error.c (name_err_receiver): raise ArgumentError if no receiver
  is available on this exception object.  [Feature #10881]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-06-23 05:32:52 +00:00
parent 8283e4fd75
commit c23a7b0db8
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Jun 23 14:32:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (name_err_receiver): raise ArgumentError if no receiver
is available on this exception object. [Feature #10881]
Tue Jun 23 09:48:34 2015 Eric Wong <e@80x24.org> Tue Jun 23 09:48:34 2015 Eric Wong <e@80x24.org>
* dir.c (check_dirname): avoid volatile, use return value * dir.c (check_dirname): avoid volatile, use return value

View file

@ -1264,7 +1264,10 @@ name_err_receiver(VALUE self)
{ {
VALUE *ptr, mesg = rb_attr_get(self, id_mesg); VALUE *ptr, mesg = rb_attr_get(self, id_mesg);
TypedData_Get_Struct(mesg, VALUE, &name_err_mesg_data_type, ptr); if (!rb_typeddata_is_kind_of(mesg, &name_err_mesg_data_type)) {
rb_raise(rb_eArgError, "no receiver is available");
}
ptr = DATA_PTR(mesg);
return ptr[NAME_ERR_MESG__RECV]; return ptr[NAME_ERR_MESG__RECV];
} }