diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-15 20:56:06 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-15 20:56:06 +0000 |
commit | ad88684786075a5da432cf372dabc6a03427853c (patch) | |
tree | 3c1d97ef78a7575df897d7f148f28a3ca75871cd /struct.c | |
parent | 43ee6d49174a82ab39c0522b3ec4d0e331fd63ba (diff) | |
parent | ede8000e64f997af26950e6f3ab2108127ed02a4 (diff) |
sorry. I made wrong tags.v1_8_5_67
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_5_67@12997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -252,7 +252,7 @@ rb_struct_define(name, va_alist) ary = rb_ary_new(); va_init_list(ar, name); - while ((mem = va_arg(ar, char*)) != 0) { + while (mem = va_arg(ar, char*)) { ID slot = rb_intern(mem); rb_ary_push(ary, ID2SYM(slot)); } @@ -557,9 +557,8 @@ rb_struct_init_copy(copy, s) if (!rb_obj_is_instance_of(s, rb_obj_class(copy))) { rb_raise(rb_eTypeError, "wrong argument class"); } - if (RSTRUCT(copy)->len != RSTRUCT(s)->len) { - rb_raise(rb_eTypeError, "struct size mismatch"); - } + RSTRUCT(copy)->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len); + RSTRUCT(copy)->len = RSTRUCT(s)->len; MEMCPY(RSTRUCT(copy)->ptr, RSTRUCT(s)->ptr, VALUE, RSTRUCT(copy)->len); return copy; |