From 62dfd48d5319ff56eda3f8a78323fd9b63912991 Mon Sep 17 00:00:00 2001 From: "Chang, Harry" Date: Wed, 8 Aug 2018 14:44:01 +0800 Subject: [PATCH] Jenkins-1080: fixed error reporting logical combination match in "A&!B" type by moving flush_comb behind report_eod_matches in hs_close_stream/hs_reset_stream. --- src/runtime.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/runtime.c b/src/runtime.c index 052449f6..9fbb8e81 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -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);