mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@2764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3bf972993f
commit
40bc4f5ae4
14 changed files with 218 additions and 179 deletions
4
struct.c
4
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue