[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:
Tony Tung 2016-08-04 13:52:41 -07:00
parent 4fc0694b79
commit 437072e8ec

View File

@ -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,