Fix "package add" heap compacting
PackageWriterImpl::_CompactHeap(): Incorrectly used fHeapEnd instead of the heap size. So the last copied chunk was too large.
This commit is contained in:
@@ -1117,9 +1117,10 @@ PackageWriterImpl::_CompactHeap()
|
||||
}
|
||||
|
||||
// move the final chunk
|
||||
if (delta > 0 && chunkOffset < fHeapEnd) {
|
||||
off_t heapSize = fHeapEnd - fHeapOffset;
|
||||
if (delta > 0 && chunkOffset < heapSize) {
|
||||
_MoveHeapChunk(chunkOffset, chunkOffset - delta,
|
||||
fHeapEnd - chunkOffset);
|
||||
heapSize - chunkOffset);
|
||||
}
|
||||
|
||||
fHeapEnd -= delta;
|
||||
|
||||
Reference in New Issue
Block a user