mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Fix variableScope
This commit is contained in:
parent
2dc4da7f2e
commit
1d4a2b2b60
@ -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;
|
||||
|
@ -1379,7 +1379,6 @@ void generate_symbol_chain(dfa_info &info, vector<symbol_t> &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<symbol_t> &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);
|
||||
|
@ -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 {
|
||||
|
@ -392,8 +392,9 @@ bool validateTransientMask(const vector<CharReach> &mask, bool anchored,
|
||||
none_of(begin(lits), end(lits), mixed_sensitivity));
|
||||
|
||||
// Build the HWLM literal mask.
|
||||
vector<u8> msk, lcmp;
|
||||
vector<u8> msk;
|
||||
if (grey.roseHamsterMasks) {
|
||||
vector<u8> lcmp;
|
||||
buildLiteralMask(mask, msk, lcmp, delay);
|
||||
}
|
||||
|
||||
|
@ -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<u32> buildSuffixEkeyLists(const RoseBuildImpl &build, build_context &bc,
|
||||
|
||||
for (const auto &e : bc.suffixes) {
|
||||
const suffix_id &s = e.first;
|
||||
u32 qi = e.second;
|
||||
set<u32> 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user