summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-29 09:08:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-29 09:08:18 +0000
commite9a7798217735e3613b27cc16e0881b4c6875ad5 (patch)
tree834cc2146161802fb97d89f0a747ae794048169b /struct.c
parentec446f90ef6c2809ef05a6d1d564cb712d99df10 (diff)
downloadruby-e9a7798217735e3613b27cc16e0881b4c6875ad5.tar.gz
ruby-e9a7798217735e3613b27cc16e0881b4c6875ad5.tar.xz
ruby-e9a7798217735e3613b27cc16e0881b4c6875ad5.zip
* array.c (rb_ary_become): should not free ptr if it's shared.
* eval.c (rb_alias): prohibit making an alias named "allocate" if klass is a metaclass. * string.c (rb_string_value_ptr): StringValuePtr() should never return NULL pointer. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index 1a378c865..437819698 100644
--- a/struct.c
+++ b/struct.c
@@ -424,8 +424,8 @@ static VALUE
rb_struct_become(clone, s)
VALUE clone, s;
{
- if (!rb_obj_is_kind_of(s, rb_obj_class(clone))) {
- rb_raise(rb_eTypeError, "wrong argument type");
+ if (!rb_obj_is_instance_of(s, rb_obj_class(clone))) {
+ rb_raise(rb_eTypeError, "wrong argument class");
}
RSTRUCT(clone)->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len);
RSTRUCT(clone)->len = RSTRUCT(s)->len;