Comment why negative blocksize in poolGrow is hard to test
Add comment tags so lcov can ignore untestable code
@@ -6937,8 +6937,15 @@ poolGrow(STRING_POOL *pool)
// to avoid dangling pointers:
const ptrdiff_t offsetInsideBlock = pool->ptr - pool->start;
- if (blockSize < 0)
- return XML_FALSE;
+ if (blockSize < 0) {
+ /* This condition traps a situation where either more than
+ * INT_MAX/2 bytes have already been allocated. This isn't
+ * readily testable, since it is unlikely that an average
+ * machine will have that much memory, so we exclude it from the
+ * coverage statistics.
+ */
+ return XML_FALSE; /* LCOV_EXCL_LINE */
+ }
bytesToAllocate = poolBytesToAllocateFor(blockSize);
if (bytesToAllocate == 0)
