Revert "remove unused guard"

This reverts commit ea90800e56.
This commit is contained in:
Yuichi Nishiwaki 2015-07-15 23:28:45 +09:00
parent ea90800e56
commit 13f16e3e09
1 changed files with 2 additions and 1 deletions

View File

@ -224,6 +224,7 @@ gc_free(pic_state *pic, union header *bp)
union header *freep, *p;
assert(bp != NULL);
assert(bp->s.size > 1);
freep = pic->heap->freep;
for (p = freep; ! (bp > p && bp < p->s.ptr); p = p->s.ptr) {
@ -238,7 +239,7 @@ gc_free(pic_state *pic, union header *bp)
else {
bp->s.ptr = p->s.ptr;
}
if (p + p->s.size == bp) {
if (p + p->s.size == bp && p->s.size > 1) {
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
}