Skip to content

Commit

Permalink
Rose: extend handling for unexpected logical combination programs
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangwang1 committed Apr 10, 2019
1 parent 6dc9bed commit 28786eb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@ hs_error_t HS_CDECL hs_scan(const hs_database_t *db, const char *data,
if (rose->flushCombProgramOffset) {
if (roseRunFlushCombProgram(rose, scratch, ~0ULL) == MO_HALT_MATCHING) {
unmarkScratchInUse(scratch);
if (unlikely(internal_matching_error(scratch))) {
return HS_UNKNOWN_ERROR;
}

return HS_SCAN_TERMINATED;
}
}
Expand Down Expand Up @@ -1011,6 +1015,10 @@ hs_error_t HS_CDECL hs_close_stream(hs_stream_t *id, hs_scratch_t *scratch,
if (roseRunFlushCombProgram(id->rose, scratch, ~0ULL)
== MO_HALT_MATCHING) {
scratch->core_info.status |= STATUS_TERMINATED;
unmarkScratchInUse(scratch);
if (unlikely(internal_matching_error(scratch))) {
return HS_UNKNOWN_ERROR;
}
}
}

Expand Down Expand Up @@ -1046,6 +1054,10 @@ hs_error_t HS_CDECL hs_reset_stream(hs_stream_t *id, UNUSED unsigned int flags,
if (roseRunFlushCombProgram(id->rose, scratch, ~0ULL)
== MO_HALT_MATCHING) {
scratch->core_info.status |= STATUS_TERMINATED;
unmarkScratchInUse(scratch);
if (unlikely(internal_matching_error(scratch))) {
return HS_UNKNOWN_ERROR;
}
}
}

Expand Down

0 comments on commit 28786eb

Please sign in to comment.