Processed count issue with maxCount
The following icgrep invocation segfaults on master.
bin/icgrep -m=2 -colors=always '=(?:[a-z]{4,5}){2,};' ../QA/testfiles/bounded_charclass
With -EnableAsserts, there is a large discrepancy in processed counts:
P4_fb430f870e5a0db883214377c71f970f5dc49bbd_EA: 17.LineSpans+CMCompressed_EA.LineEnds: processed count (2688) exceeds total count (1076) (Thread # 7f3fd0dde780)
1076 is the number of bytes in the first 11 lines; line 11 is the second line matched 2707 is the number of bytes in the input file 111../QA/testfiles/bounded_charclass'''
A logic problem for the pipeline in this case is that the MatchedLineEnds stream is truncated, but then a FilterByMask operation is applied: FilterByMask(E, mLineBreakStream, MatchedLineEnds, MatchesByLine);
Here the mLineBreakStream is used as the mask, but it is longer than MatchedLineEnds. It appears that the system treats MatchedLineEnds as ZeroExtended (although not declared that way). As a result MatchesByLine is of length 37, rather than 11. In this case, if we apply the rule that we truncate to the shortest input stream, we would truncate mLineBreakStream to the length of MatchedLineEnds, before using the popcount rate on the truncated mLineBreakStream to determine the length of MatchesByLine.