From: Justin Viiret Date: Thu, 29 Oct 2015 22:33:04 +0000 (+1100) Subject: assignStringsToBuckets: assert that there are lits X-Git-Tag: v4.1.0^2~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6383a54a42847fe5c23682898ebf026c40c421f;p=thirdparty%2Fvectorscan.git assignStringsToBuckets: assert that there are lits --- diff --git a/src/fdr/fdr_compile.cpp b/src/fdr/fdr_compile.cpp index 8d658ccd..8f1f3e03 100644 --- a/src/fdr/fdr_compile.cpp +++ b/src/fdr/fdr_compile.cpp @@ -245,6 +245,8 @@ void FDRCompiler::assignStringsToBuckets() { typedef pair SCORE_INDEX_PAIR; u32 ls = verify_u32(lits.size()); + assert(ls); // Shouldn't be called with no literals. + // make a vector that contains our literals as pointers or u32 LiteralIndex values vector vli; vli.resize(ls); @@ -292,6 +294,8 @@ void FDRCompiler::assignStringsToBuckets() { currentChunk++; } } + + assert(currentChunk > 0); count[currentChunk - 1] = ls - chunkStartID; // close off chunks with an empty row firstIds[currentChunk] = ls;