mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
[cdatapack] fix bug in following deltabasenode pointers
Summary: The raw index is a byte offset, not an entry number. I hope the compiler is smart enough to optimize out the divide and multiply. :) Test Plan: cdatapack_get on a delta chain that has a deltabasenode does not crash! Reviewers: #fastmanifest, durham Reviewed By: durham Subscribers: mitrandir Differential Revision: https://phabricator.intern.facebook.com/D3667033 Signature: t1:3667033:1470341429:b37da6c9ea6e37fe79b48ec6766c857b5e56c36a
This commit is contained in:
parent
4fc0694b79
commit
437072e8ec
@ -352,8 +352,10 @@ static pack_chain_t *build_pack_chain(
|
||||
|
||||
while (entry.deltabase_index_offset != FULLTEXTINDEXMARK &&
|
||||
entry.deltabase_index_offset != NOBASEINDEXMARK) {
|
||||
index_offset_t index_num = entry.deltabase_index_offset /
|
||||
sizeof(disk_index_entry_t);
|
||||
unpack_disk_deltachunk(
|
||||
&handle->index_table[entry.deltabase_index_offset], &entry);
|
||||
&handle->index_table[index_num], &entry);
|
||||
|
||||
PACK_CHAIN_EXPAND_TO_FIT(
|
||||
(void **)&result->pack_chain_links,
|
||||
|
Loading…
Reference in New Issue
Block a user