diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-05 04:41:21 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-05 04:41:21 +0000 |
commit | de7161526014b781468cea5d84411e23be945f79 (patch) | |
tree | ce7e90b3c16ce6246be9850c9b1ea1328992c0e7 /struct.c | |
parent | a1d1b1516750c1047ceb7010f8f5ca34b358c7e3 (diff) |
20000105
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -407,14 +407,14 @@ static VALUE rb_struct_clone(s) VALUE s; { - NEWOBJ(st, struct RStruct); - CLONESETUP(st, s); - st->len = 0; /* avoid GC crashing */ - st->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len); - st->len = RSTRUCT(s)->len; - MEMCPY(st->ptr, RSTRUCT(s)->ptr, VALUE, st->len); - - return (VALUE)st; + NEWOBJ(clone, struct RStruct); + CLONESETUP(clone, s); + clone->len = 0; /* avoid GC crashing */ + clone->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len); + clone->len = RSTRUCT(s)->len; + MEMCPY(clone->ptr, RSTRUCT(s)->ptr, VALUE, clone->len); + + return (VALUE)clone; } static VALUE |