]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
roseSuffixesEod: trust the queue structure
authorJustin Viiret <justin.viiret@intel.com>
Tue, 14 Jun 2016 04:22:42 +0000 (14:22 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 8 Jul 2016 00:55:36 +0000 (10:55 +1000)
src/rose/program_runtime.h

index 30ecb4f7841fe420d0b410df783eedc67fbd67fa..4537c55b36b34717242d2f4f54b4ba858242a523 100644 (file)
@@ -859,32 +859,25 @@ hwlmcb_rv_t roseSuffixesEod(const struct RoseEngine *rose,
 
     for (u32 qi = mmbit_iterate(aa, aaCount, MMB_INVALID); qi != MMB_INVALID;
          qi = mmbit_iterate(aa, aaCount, qi)) {
-        const struct NfaInfo *info = getNfaInfoByQueue(rose, qi);
-        const struct NFA *nfa = getNfaByInfo(rose, info);
-
-        assert(nfaAcceptsEod(nfa));
-
         DEBUG_PRINTF("checking nfa %u\n", qi);
+        struct mq *q = scratch->queues + qi;
+        assert(q->nfa == getNfaByQueue(rose, qi));
+        assert(nfaAcceptsEod(q->nfa));
 
         /* We have just been triggered. */
         assert(fatbit_isset(scratch->aqa, rose->queueCount, qi));
 
-        char *fstate = scratch->fullState + info->fullStateOffset;
-        const char *sstate = scratch->core_info.state + info->stateOffset;
-
-        struct mq *q = scratch->queues + qi;
-
         pushQueueNoMerge(q, MQE_END, scratch->core_info.len);
-
         q->context = NULL;
+
         /* rose exec is used as we don't want to / can't raise matches in the
          * history buffer. */
         if (!nfaQueueExecRose(q->nfa, q, MO_INVALID_IDX)) {
             DEBUG_PRINTF("nfa is dead\n");
             continue;
         }
-        if (nfaCheckFinalState(nfa, fstate, sstate, offset, roseReportAdaptor,
-                               roseReportSomAdaptor,
+        if (nfaCheckFinalState(q->nfa, q->state, q->streamState, offset,
+                               roseReportAdaptor, roseReportSomAdaptor,
                                scratch) == MO_HALT_MATCHING) {
             DEBUG_PRINTF("user instructed us to stop\n");
             return HWLM_TERMINATE_MATCHING;