]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Jenkins-1080: fixed error reporting logical combination match in "A&!B" type by
authorChang, Harry <harry.chang@intel.com>
Wed, 8 Aug 2018 06:44:01 +0000 (14:44 +0800)
committerChang, Harry <harry.chang@intel.com>
Mon, 21 Jan 2019 01:56:12 +0000 (09:56 +0800)
moving flush_comb behind report_eod_matches in hs_close_stream/hs_reset_stream.

src/runtime.c

index 052449f61f460db5e055b06d7f1cba7342f1b901..9fbb8e817b7535cef5025d63258b0596b92ae3cc 100644 (file)
@@ -934,12 +934,6 @@ hs_error_t hs_scan_stream_internal(hs_stream_t *id, const char *data,
         }
     }
 
-    if (rose->flushCombProgramOffset && !told_to_stop_matching(scratch)) {
-        if (roseRunFlushCombProgram(rose, scratch, ~0ULL) == MO_HALT_MATCHING) {
-            scratch->core_info.status |= STATUS_TERMINATED;
-        }
-    }
-
     setStreamStatus(state, scratch->core_info.status);
 
     if (likely(!can_stop_matching(scratch))) {
@@ -994,6 +988,13 @@ hs_error_t HS_CDECL hs_close_stream(hs_stream_t *id, hs_scratch_t *scratch,
         unmarkScratchInUse(scratch);
     }
 
+    if (id->rose->flushCombProgramOffset && !told_to_stop_matching(scratch)) {
+        if (roseRunFlushCombProgram(id->rose, scratch, ~0ULL)
+            == MO_HALT_MATCHING) {
+            scratch->core_info.status |= STATUS_TERMINATED;
+        }
+    }
+
     hs_stream_free(id);
 
     return HS_SUCCESS;
@@ -1019,6 +1020,13 @@ hs_error_t HS_CDECL hs_reset_stream(hs_stream_t *id, UNUSED unsigned int flags,
         unmarkScratchInUse(scratch);
     }
 
+    if (id->rose->flushCombProgramOffset && !told_to_stop_matching(scratch)) {
+        if (roseRunFlushCombProgram(id->rose, scratch, ~0ULL)
+            == MO_HALT_MATCHING) {
+            scratch->core_info.status |= STATUS_TERMINATED;
+        }
+    }
+
     // history already initialised
     init_stream(id, id->rose, 0);