diff options
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zenserver/cache/cachedisklayer.h | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a46f6d7fa..d36aaf3f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## - Bugfix: Fix index out of bounds in CacheBucket::CompactState +- Bugfix: Implement != operator for DiskLocation to avoid comparing uninitialized data - Improvement: Shrink data structures to fit after CacheBucket::CompactReferences ## 0.2.32 diff --git a/src/zenserver/cache/cachedisklayer.h b/src/zenserver/cache/cachedisklayer.h index d46d629e4..d9884a7bc 100644 --- a/src/zenserver/cache/cachedisklayer.h +++ b/src/zenserver/cache/cachedisklayer.h @@ -34,7 +34,18 @@ struct DiskLocation this->Location.BlockLocation = BlockStoreDiskLocation(Location, PayloadAlignment); } - inline bool operator!=(const DiskLocation& Rhs) const { return memcmp(&Location, &Rhs.Location, sizeof(Location)) != 0; } + inline bool operator!=(const DiskLocation& Rhs) const + { + if (Flags != Rhs.Flags) + { + return true; + } + if (Flags & kStandaloneFile) + { + return Location.StandaloneSize != Rhs.Location.StandaloneSize; + } + return Location.BlockLocation != Rhs.Location.BlockLocation; + } inline BlockStoreLocation GetBlockLocation(uint64_t PayloadAlignment) const { |