diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-29 09:08:18 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-29 09:08:18 +0000 |
commit | e9a7798217735e3613b27cc16e0881b4c6875ad5 (patch) | |
tree | 834cc2146161802fb97d89f0a747ae794048169b /file.c | |
parent | ec446f90ef6c2809ef05a6d1d564cb712d99df10 (diff) | |
download | ruby-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 'file.c')
-rw-r--r-- | file.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -2027,8 +2027,12 @@ rb_stat_become(obj, orig) struct stat *nst; /* need better argument type check */ - if (!rb_obj_is_kind_of(orig, rb_obj_class(obj))) { - rb_raise(rb_eTypeError, "wrong argument type"); + if (!rb_obj_is_instance_of(orig, rb_obj_class(obj))) { + rb_raise(rb_eTypeError, "wrong argument class"); + } + if (DATA_PTR(obj)) { + free(DATA_PTR(obj)); + DATA_PTR(obj) = 0; } if (DATA_PTR(orig)) { nst = ALLOC(struct stat); |