mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-10 08:12:21 +03:00
noodle: behave like our other literal matchers
Noodle now supports supplementary masks.
This commit is contained in:
@@ -184,20 +184,18 @@ hwlm_error_t hwlmExec(const struct HWLM *t, const u8 *buf, size_t len,
|
||||
|
||||
if (t->type == HWLM_ENGINE_NOOD) {
|
||||
DEBUG_PRINTF("calling noodExec\n");
|
||||
return noodExec(HWLM_C_DATA(t), buf + start, len - start, start, cb,
|
||||
ctxt);
|
||||
} else {
|
||||
assert(t->type == HWLM_ENGINE_FDR);
|
||||
const union AccelAux *aa = &t->accel0;
|
||||
if ((groups & ~t->accel1_groups) == 0) {
|
||||
DEBUG_PRINTF("using hq accel %hhu\n", t->accel1.accel_type);
|
||||
aa = &t->accel1;
|
||||
}
|
||||
do_accel_block(aa, buf, len, &start);
|
||||
DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups,
|
||||
start);
|
||||
return fdrExec(HWLM_C_DATA(t), buf, len, start, cb, ctxt, groups);
|
||||
return noodExec(HWLM_C_DATA(t), buf, len, start, cb, ctxt);
|
||||
}
|
||||
|
||||
assert(t->type == HWLM_ENGINE_FDR);
|
||||
const union AccelAux *aa = &t->accel0;
|
||||
if ((groups & ~t->accel1_groups) == 0) {
|
||||
DEBUG_PRINTF("using hq accel %hhu\n", t->accel1.accel_type);
|
||||
aa = &t->accel1;
|
||||
}
|
||||
do_accel_block(aa, buf, len, &start);
|
||||
DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups, start);
|
||||
return fdrExec(HWLM_C_DATA(t), buf, len, start, cb, ctxt, groups);
|
||||
}
|
||||
|
||||
hwlm_error_t hwlmExecStreaming(const struct HWLM *t, struct hs_scratch *scratch,
|
||||
@@ -224,23 +222,21 @@ hwlm_error_t hwlmExecStreaming(const struct HWLM *t, struct hs_scratch *scratch,
|
||||
// If we've been handed a start offset, we can use a block mode scan at
|
||||
// that offset.
|
||||
if (start) {
|
||||
return noodExec(HWLM_C_DATA(t), buf + start, len - start, start,
|
||||
cb, ctxt);
|
||||
return noodExec(HWLM_C_DATA(t), buf, len, start, cb, ctxt);
|
||||
} else {
|
||||
return noodExecStreaming(HWLM_C_DATA(t), hbuf, hlen, buf, len, cb,
|
||||
ctxt);
|
||||
}
|
||||
} else {
|
||||
// t->type == HWLM_ENGINE_FDR
|
||||
const union AccelAux *aa = &t->accel0;
|
||||
if ((groups & ~t->accel1_groups) == 0) {
|
||||
DEBUG_PRINTF("using hq accel %hhu\n", t->accel1.accel_type);
|
||||
aa = &t->accel1;
|
||||
}
|
||||
do_accel_streaming(aa, hbuf, hlen, buf, len, &start);
|
||||
DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups,
|
||||
start);
|
||||
return fdrExecStreaming(HWLM_C_DATA(t), hbuf, hlen, buf, len,
|
||||
start, cb, ctxt, groups);
|
||||
}
|
||||
|
||||
assert(t->type == HWLM_ENGINE_FDR);
|
||||
const union AccelAux *aa = &t->accel0;
|
||||
if ((groups & ~t->accel1_groups) == 0) {
|
||||
DEBUG_PRINTF("using hq accel %hhu\n", t->accel1.accel_type);
|
||||
aa = &t->accel1;
|
||||
}
|
||||
do_accel_streaming(aa, hbuf, hlen, buf, len, &start);
|
||||
DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups, start);
|
||||
return fdrExecStreaming(HWLM_C_DATA(t), hbuf, hlen, buf, len, start, cb,
|
||||
ctxt, groups);
|
||||
}
|
||||
|
Reference in New Issue
Block a user