Fix bug introduced in 5e1fb1dac5
All checks were successful
Tests / Release [gcc] total: 704, passed: 704
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|1|0|1|0|:zzz:
Tests / Release [gcc,aarch64] total: 703, passed: 703
Tests / Coverage total: 702, passed: 702
weaselab/conflict-set/pipeline/head This commit looks good
All checks were successful
Tests / Release [gcc] total: 704, passed: 704
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|1|0|1|0|:zzz:
Tests / Release [gcc,aarch64] total: 703, passed: 703
Tests / Coverage total: 702, passed: 702
weaselab/conflict-set/pipeline/head This commit looks good
This commit is contained in:
@@ -239,9 +239,13 @@ struct Node {
|
||||
int8_t partialKeyLen = 0;
|
||||
int32_t numChildren = 0;
|
||||
Node *parent = nullptr;
|
||||
uint8_t partialKey[kPartialKeyMaxLenEntryPresent];
|
||||
// If not entryPresent, then the partial key might spill over into entry
|
||||
Entry entry;
|
||||
union {
|
||||
uint8_t partialKey[kPartialKeyMaxLenEntryPresent + sizeof(Entry)];
|
||||
struct {
|
||||
uint8_t padding[kPartialKeyMaxLenEntryPresent];
|
||||
Entry entry;
|
||||
};
|
||||
};
|
||||
/* end section that's copied to the next node */
|
||||
};
|
||||
|
||||
@@ -1536,8 +1540,13 @@ template <bool kBegin>
|
||||
for (;;) {
|
||||
|
||||
if ((*self)->partialKeyLen > 0) {
|
||||
const bool wouldBePresent =
|
||||
key.size() <= kPartialKeyMaxLenEntryPresent + int(sizeof(Entry));
|
||||
// Handle an existing partial key
|
||||
int commonLen = std::min<int>((*self)->partialKeyLen, key.size());
|
||||
if (wouldBePresent) {
|
||||
commonLen = std::min(commonLen, kPartialKeyMaxLenEntryPresent);
|
||||
}
|
||||
int partialKeyIndex = longestCommonPrefixPartialKey(
|
||||
(*self)->partialKey, key.data(), commonLen);
|
||||
if (partialKeyIndex < (*self)->partialKeyLen) {
|
||||
|
Reference in New Issue
Block a user