1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* array.c (rb_ary_replace): should shift lfree pointer before

calling xfree.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2006-10-11 08:01:25 +00:00
parent 513d286ed0
commit 9681d8791b
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Wed Oct 11 16:57:46 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_replace): should shift lfree pointer before
calling xfree.
Wed Oct 11 15:07:42 2006 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/lib/digest/hmac.rb: Add digest/hmac, which implements

View file

@ -2158,7 +2158,11 @@ rb_ary_replace(VALUE copy, VALUE orig)
ARY_SET_NOEMBED(copy);
}
else {
xfree(RARRAY(copy)->as.heap.ptr);
VALUE *ptr = RARRAY(copy)->as.heap.ptr;
if (ARY_LFREE_P(copy)) {
ptr -= LFREE_SIZE(copy);
}
xfree(ptr);
}
RARRAY(copy)->as.heap.ptr = RARRAY(shared)->as.heap.ptr;
RARRAY(copy)->as.heap.len = RARRAY(shared)->as.heap.len;