Commit 6816634a authored by Kenton Varda's avatar Kenton Varda

Fix recently-introduced unit analysis errors.

parent 0197c69c
...@@ -1678,7 +1678,7 @@ struct WireHelpers { ...@@ -1678,7 +1678,7 @@ struct WireHelpers {
auto se = value.getStructElement(ec); auto se = value.getStructElement(ec);
WordCount localDataSize = declDataSize; WordCount localDataSize = declDataSize;
while (localDataSize != 0 * WORDS) { while (localDataSize != 0 * WORDS) {
size_t end = (localDataSize * BYTES_PER_WORD * BYTES) / BYTES; size_t end = localDataSize * BYTES_PER_WORD / BYTES;
ByteCount window = BYTES_PER_WORD * WORDS; ByteCount window = BYTES_PER_WORD * WORDS;
size_t start = end - window / BYTES; size_t start = end - window / BYTES;
kj::ArrayPtr<const byte> lastWord = se.getDataSectionAsBlob().slice(start, end); kj::ArrayPtr<const byte> lastWord = se.getDataSectionAsBlob().slice(start, end);
...@@ -2959,15 +2959,15 @@ bool ListReader::isCanonical(const word **readHead, const WirePointer *ref) { ...@@ -2959,15 +2959,15 @@ bool ListReader::isCanonical(const word **readHead, const WirePointer *ref) {
if (this->structDataSize % BITS_PER_WORD != 0 * BITS) { if (this->structDataSize % BITS_PER_WORD != 0 * BITS) {
return false; return false;
} }
auto structSize = (this->structDataSize / BITS_PER_WORD) + auto elementSize = (this->structDataSize / BITS_PER_WORD +
(this->structPointerCount * WORDS_PER_POINTER); this->structPointerCount * WORDS_PER_POINTER) / ELEMENTS;
if (structSize * this->elementCount != ref->listRef.inlineCompositeWordCount()) { if (elementSize * this->elementCount != ref->listRef.inlineCompositeWordCount()) {
return false; return false;
} }
if (structSize == 0 * WORDS) { if (elementSize == 0 * WORDS / ELEMENTS) {
return true; return true;
} }
auto listEnd = *readHead + (this->elementCount / ELEMENTS * structSize) / WORDS; auto listEnd = *readHead + (this->elementCount * elementSize) / WORDS;
auto pointerHead = listEnd; auto pointerHead = listEnd;
bool listDataTrunc = false; bool listDataTrunc = false;
bool listPtrTrunc = false; bool listPtrTrunc = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment