From: Wang, Xiang W Date: Wed, 27 Mar 2019 15:38:48 +0000 (-0400) Subject: Rose: extend handling for unexpected logical combination programs X-Git-Tag: v5.1.1^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28786eb269888fdf850340a60e941ae3d0ee1d24;p=thirdparty%2Fvectorscan.git Rose: extend handling for unexpected logical combination programs --- diff --git a/src/runtime.c b/src/runtime.c index 9a42dafb..49346311 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -458,6 +458,10 @@ set_retval: 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; } } @@ -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; + } } } @@ -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; + } } }