From: Justin Viiret Date: Tue, 5 Apr 2016 03:25:39 +0000 (+1000) Subject: Runtime: be more careful with status bits X-Git-Tag: v4.2.0^2~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d75cc809fe3a3af12229ce5bd1db1eae20dc79aa;p=thirdparty%2Fvectorscan.git Runtime: be more careful with status bits --- diff --git a/src/runtime.c b/src/runtime.c index 8a0cb9f9..09c0deb6 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -667,7 +667,7 @@ void report_eod_matches(hs_stream_t *id, hs_scratch_t *scratch, char *state = getMultiState(id); u8 status = getStreamStatus(state); - if (status == STATUS_TERMINATED || status == STATUS_EXHAUSTED) { + if (status & (STATUS_TERMINATED | STATUS_EXHAUSTED)) { DEBUG_PRINTF("stream is broken, just freeing storage\n"); return; } @@ -802,7 +802,7 @@ void rawStreamExec(struct hs_stream *stream_state, struct hs_scratch *scratch) { if (!told_to_stop_matching(scratch) && isAllExhausted(rose, scratch->core_info.exhaustionVector)) { DEBUG_PRINTF("stream exhausted\n"); - scratch->core_info.status = STATUS_EXHAUSTED; + scratch->core_info.status |= STATUS_EXHAUSTED; } }