mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2026-01-01 14:15:43 +03:00
fdr: move long literal handling into Rose
Move the hash table used for long literal support in streaming mode from FDR to Rose, and introduce new instructions CHECK_LONG_LIT and CHECK_LONG_LIT_NOCASE for doing literal confirm for long literals. This simplifies FDR confirm, and guarantees that HWLM matchers will only be used for literals < 256 bytes long.
This commit is contained in:
committed by
Matthew Barr
parent
6ed30194ce
commit
68bf473e2e
@@ -736,20 +736,11 @@ void pureLiteralStreamExec(struct hs_stream *stream_state,
|
||||
assert(scratch);
|
||||
assert(!can_stop_matching(scratch));
|
||||
|
||||
char *state = getMultiState(stream_state);
|
||||
|
||||
const struct RoseEngine *rose = stream_state->rose;
|
||||
const struct HWLM *ftable = getFLiteralMatcher(rose);
|
||||
|
||||
size_t len2 = scratch->core_info.len;
|
||||
|
||||
u8 *hwlm_stream_state;
|
||||
if (rose->floatingStreamState) {
|
||||
hwlm_stream_state = getFloatingMatcherState(rose, state);
|
||||
} else {
|
||||
hwlm_stream_state = NULL;
|
||||
}
|
||||
|
||||
DEBUG_PRINTF("::: streaming rose ::: offset = %llu len = %zu\n",
|
||||
stream_state->offset, scratch->core_info.len);
|
||||
|
||||
@@ -761,8 +752,8 @@ void pureLiteralStreamExec(struct hs_stream *stream_state,
|
||||
// start the match region at zero.
|
||||
const size_t start = 0;
|
||||
|
||||
hwlmExecStreaming(ftable, scratch, len2, start, roseCallback,
|
||||
scratch, rose->initialGroups, hwlm_stream_state);
|
||||
hwlmExecStreaming(ftable, scratch, len2, start, roseCallback, scratch,
|
||||
rose->initialGroups);
|
||||
|
||||
if (!told_to_stop_matching(scratch) &&
|
||||
isAllExhausted(rose, scratch->core_info.exhaustionVector)) {
|
||||
|
||||
Reference in New Issue
Block a user