Commit 09b28b97 authored by David Renshaw's avatar David Renshaw

use assertMax() to get CAPNP_DEBUG_TYPES analysis to pass

parent 47452aa7
......@@ -1812,7 +1812,10 @@ struct WireHelpers {
// List of data.
ref->listRef.set(value.elementSize, value.elementCount);
auto wholeByteSize = upgradeBound<uint64_t>(value.elementCount) * value.step / BITS_PER_BYTE;
auto wholeByteSize =
assertMax<kj::maxValueForBits<SEGMENT_WORD_COUNT_BITS + 3>() - 1>(
upgradeBound<uint64_t>(value.elementCount) * value.step / BITS_PER_BYTE,
[]() { KJ_FAIL_ASSERT("encountered impossibly long data ListReader"); });
copyMemory(reinterpret_cast<byte*>(ptr), value.ptr, wholeByteSize);
auto leftoverBits =
(upgradeBound<uint64_t>(value.elementCount) * value.step) % (BYTES * BITS_PER_BYTE);
......
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