diff --git a/src/nfa/gough.c b/src/nfa/gough.c index d0ea0bbd..f0d5bc64 100644 --- a/src/nfa/gough.c +++ b/src/nfa/gough.c @@ -978,7 +978,6 @@ char nfaExecGough16_initCompressedState(const struct NFA *nfa, u64a offset, char nfaExecGough8_reportCurrent(const struct NFA *n, struct mq *q) { const struct mcclellan *m = (const struct mcclellan *)getImplNfa(n); NfaCallback cb = q->cb; - void *ctxt = q->context; u8 s = *(u8 *)q->state; u64a offset = q_cur_offset(q); const struct gough_som_info *som = getSomInfo(q->state); @@ -986,6 +985,7 @@ char nfaExecGough8_reportCurrent(const struct NFA *n, struct mq *q) { assert(s); if (s >= m->accept_limit_8) { + void *ctxt = q->context; u32 cached_accept_id = 0; u16 cached_accept_state = 0; u32 cached_accept_som = 0; @@ -1000,7 +1000,6 @@ char nfaExecGough8_reportCurrent(const struct NFA *n, struct mq *q) { char nfaExecGough16_reportCurrent(const struct NFA *n, struct mq *q) { const struct mcclellan *m = (const struct mcclellan *)getImplNfa(n); NfaCallback cb = q->cb; - void *ctxt = q->context; u16 s = *(u16 *)q->state; const struct mstate_aux *aux = get_aux(m, s); u64a offset = q_cur_offset(q); @@ -1010,6 +1009,7 @@ char nfaExecGough16_reportCurrent(const struct NFA *n, struct mq *q) { assert(s); if (aux->accept) { + void *ctxt = q->context; u32 cached_accept_id = 0; u16 cached_accept_state = 0; u32 cached_accept_som = 0; diff --git a/src/nfa/mcclellancompile.cpp b/src/nfa/mcclellancompile.cpp index 6ada4e50..bf9b407a 100644 --- a/src/nfa/mcclellancompile.cpp +++ b/src/nfa/mcclellancompile.cpp @@ -1379,7 +1379,6 @@ void generate_symbol_chain(dfa_info &info, vector &chain_tail) { for (size_t j = 0; j < width; j++) { dstate_id_t curr_id = state_chain[j]; - dstate_id_t next_id = state_chain[j + 1]; // The last state of the chain doesn't belong to a wide state. info.extra[curr_id].wideState = true; @@ -1388,6 +1387,7 @@ void generate_symbol_chain(dfa_info &info, vector &chain_tail) { if (j == width - 1) { symbol_chain.emplace_back(chain_tail[i]); } else { + dstate_id_t next_id = state_chain[j + 1]; for (symbol_t sym = 0; sym < info.impl_alpha_size; sym++) { if (rdfa.states[curr_id].next[sym] == next_id) { symbol_chain.emplace_back(sym); diff --git a/src/nfa/sheng.c b/src/nfa/sheng.c index 922e8f80..e6b299d4 100644 --- a/src/nfa/sheng.c +++ b/src/nfa/sheng.c @@ -814,7 +814,6 @@ char nfaExecSheng_testEOD(const struct NFA *nfa, const char *state, char nfaExecSheng_reportCurrent(const struct NFA *n, struct mq *q) { const struct sheng *sh = (const struct sheng *)getImplNfa(n); NfaCallback cb = q->cb; - void *ctxt = q->context; u8 s = *(u8 *)q->state; const struct sstate_aux *aux = get_aux(sh, s); u64a offset = q_cur_offset(q); @@ -823,6 +822,7 @@ char nfaExecSheng_reportCurrent(const struct NFA *n, struct mq *q) { assert(q_cur_type(q) == MQE_START); if (aux->accept) { + void *ctxt = q->context; if (sh->flags & SHENG_FLAG_SINGLE_REPORT) { fireSingleReport(cb, ctxt, sh->report, offset); } else { diff --git a/src/rose/rose_build_add_mask.cpp b/src/rose/rose_build_add_mask.cpp index 05f3a620..5312e6c8 100644 --- a/src/rose/rose_build_add_mask.cpp +++ b/src/rose/rose_build_add_mask.cpp @@ -392,8 +392,9 @@ bool validateTransientMask(const vector &mask, bool anchored, none_of(begin(lits), end(lits), mixed_sensitivity)); // Build the HWLM literal mask. - vector msk, lcmp; + vector msk; if (grey.roseHamsterMasks) { + vector lcmp; buildLiteralMask(mask, msk, lcmp, delay); } diff --git a/src/rose/rose_build_bytecode.cpp b/src/rose/rose_build_bytecode.cpp index b456c0b5..df24a234 100644 --- a/src/rose/rose_build_bytecode.cpp +++ b/src/rose/rose_build_bytecode.cpp @@ -1901,8 +1901,8 @@ void findExclusiveSuffixes(RoseBuildImpl &tbi, build_context &bc, // We may have already built this NFA. if (contains(suffixes, s)) { - u32 id = suffixes[s]; if (!tbi.isInETable(v)) { + u32 id = suffixes[s]; vertex_map[id].emplace_back(v); } continue; @@ -2233,10 +2233,10 @@ vector buildSuffixEkeyLists(const RoseBuildImpl &build, build_context &bc, for (const auto &e : bc.suffixes) { const suffix_id &s = e.first; - u32 qi = e.second; set ekeys = reportsToEkeys(all_reports(s), build.rm); if (!ekeys.empty()) { + u32 qi = e.second; qi_to_ekeys[qi] = {ekeys.begin(), ekeys.end()}; } } @@ -2987,7 +2987,7 @@ void buildFragmentPrograms(const RoseBuildImpl &build, const auto &cfrag = fragments[pfrag.included_frag_id]; /** assert(pfrag.s.length() >= cfrag.s.length() && **/ assert(pfrag.s.length() == cfrag.s.length() && - !pfrag.s.any_nocase() >= !cfrag.s.any_nocase()); + !pfrag.s.any_nocase() != !cfrag.s.any_nocase()); u32 child_offset = cfrag.delay_program_offset; DEBUG_PRINTF("child %u offset %u\n", cfrag.fragment_id, child_offset);