Logical Combination: avoid corruption of pending combination report

in streaming mode.

Fixes github issue #165
This commit is contained in:
Chang, Harry
2019-06-06 15:12:24 +08:00
parent 1f4c10a58d
commit 64ea43ea39
2 changed files with 29 additions and 6 deletions

View File

@@ -652,7 +652,9 @@ void report_eod_matches(hs_stream_t *id, hs_scratch_t *scratch,
scratch->core_info.logicalVector = state +
rose->stateOffsets.logicalVec;
scratch->core_info.combVector = state + rose->stateOffsets.combVec;
scratch->tctxt.lastCombMatchOffset = id->offset;
if (!id->offset) {
scratch->tctxt.lastCombMatchOffset = id->offset;
}
}
if (rose->somLocationCount) {
@@ -908,7 +910,9 @@ hs_error_t hs_scan_stream_internal(hs_stream_t *id, const char *data,
scratch->core_info.logicalVector = state +
rose->stateOffsets.logicalVec;
scratch->core_info.combVector = state + rose->stateOffsets.combVec;
scratch->tctxt.lastCombMatchOffset = id->offset;
if (!id->offset) {
scratch->tctxt.lastCombMatchOffset = id->offset;
}
}
assert(scratch->core_info.hlen <= id->offset
&& scratch->core_info.hlen <= rose->historyRequired);