mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Don't use depth for in-flight check
This commit is contained in:
parent
3d87e382fa
commit
14f18bd6e8
@ -233,7 +233,7 @@ void roseBlockExec_i(const struct RoseEngine *t, struct hs_scratch *scratch,
|
||||
if (ftable) {
|
||||
DEBUG_PRINTF("ftable fd=%u fmd %u\n", t->floatingDistance,
|
||||
t->floatingMinDistance);
|
||||
if (t->noFloatingRoots && tctxt->depth == 1) {
|
||||
if (t->noFloatingRoots && !roseHasInFlightMatches(t, state, scratch)) {
|
||||
DEBUG_PRINTF("skip FLOATING: no inflight matches\n");
|
||||
goto exit;
|
||||
}
|
||||
|
@ -299,4 +299,25 @@ void roseFlushLastByteHistory(const struct RoseEngine *t, u8 *state,
|
||||
mmbit_sparse_iter_unset(role_state, numStates, it, si_state);
|
||||
}
|
||||
|
||||
static rose_inline
|
||||
int roseHasInFlightMatches(const struct RoseEngine *t, u8 *state,
|
||||
const struct hs_scratch *scratch) {
|
||||
if (scratch->al_log_sum) {
|
||||
DEBUG_PRINTF("anchored literals in log\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (scratch->tctxt.filledDelayedSlots) {
|
||||
DEBUG_PRINTF("delayed literal\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mmbit_any(getRoleState(state), t->rolesWithStateCount)) {
|
||||
DEBUG_PRINTF("role state is set\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -502,7 +502,7 @@ void roseStreamExec(const struct RoseEngine *t, u8 *state,
|
||||
|
||||
const struct HWLM *ftable = getFLiteralMatcher(t);
|
||||
if (ftable) {
|
||||
if (t->noFloatingRoots && tctxt->depth == 1) {
|
||||
if (t->noFloatingRoots && !roseHasInFlightMatches(t, state, scratch)) {
|
||||
DEBUG_PRINTF("skip FLOATING: no inflight matches\n");
|
||||
goto flush_delay_and_exit;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user