Fix bugs found through fuzzing
This commit is contained in:
12
Facade.h
12
Facade.h
@@ -29,12 +29,6 @@ struct Facade {
|
|||||||
const int64_t v[] = {version, version};
|
const int64_t v[] = {version, version};
|
||||||
facade->versioned.firstGeq(key, v, versionedIter, 2);
|
facade->versioned.firstGeq(key, v, versionedIter, 2);
|
||||||
|
|
||||||
if (versionedIter[0] == versionedIter[1]) {
|
|
||||||
// No mutations intersect [begin, end)
|
|
||||||
facade->unversionedRead(begin, end, limit, reverse, result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure versionedIter[1] param1 is >= `end`
|
// Make sure versionedIter[1] param1 is >= `end`
|
||||||
if (versionedIter[1] != facade->versioned.end(version)) {
|
if (versionedIter[1] != facade->versioned.end(version)) {
|
||||||
auto m = *versionedIter[1];
|
auto m = *versionedIter[1];
|
||||||
@@ -43,6 +37,12 @@ struct Facade {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (versionedIter[0] == versionedIter[1]) {
|
||||||
|
// No mutations intersect [begin, end)
|
||||||
|
facade->unversionedRead(begin, end, limit, reverse, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
static const uint8_t zero_[] = {0};
|
static const uint8_t zero_[] = {0};
|
||||||
static const String zero{zero_, 1};
|
static const String zero{zero_, 1};
|
||||||
|
|
||||||
|
@@ -653,7 +653,14 @@ struct __attribute__((__visibility__("hidden"))) VersionedMap::Impl {
|
|||||||
rangeVersion = latestVersion;
|
rangeVersion = latestVersion;
|
||||||
if (inserted) {
|
if (inserted) {
|
||||||
val = {nullptr, -1}; // Sentinel for "no point mutation here"
|
val = {nullptr, -1}; // Sentinel for "no point mutation here"
|
||||||
pointVersion = -1; // Sentinel for "no point mutation here"
|
Finger copy;
|
||||||
|
finger.copyTo(copy);
|
||||||
|
move<std::memory_order_relaxed>(copy, latestVersion, true);
|
||||||
|
if (copy.searchPathSize() == 0) {
|
||||||
|
pointVersion = -1; // Sentinel for "no mutation ending here"
|
||||||
|
} else {
|
||||||
|
pointVersion = mm.base[copy.backNode()].entry->rangeVersion;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
auto *entry = mm.base[finger.backNode()].entry;
|
auto *entry = mm.base[finger.backNode()].entry;
|
||||||
val = {entry->getVal(), entry->valLen};
|
val = {entry->getVal(), entry->valLen};
|
||||||
|
Reference in New Issue
Block a user