mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-15 17:02:14 +03:00
Bugfix/fix avx512vbmi regressions (#335)
Multiple AVX512VBMI-related fixes: src/nfa/mcsheng_compile.cpp: No need for an assert here, impl_id can be set to 0 src/nfa/nfa_api_queue.h: Make sure this compiles on both C++ and C src/nfagraph/ng_fuzzy.cpp: Fix compilation error when DEBUG_OUTPUT=on src/runtime.c: Fix crash when data == NULL unit/internal/sheng.cpp: Unit test has to enable AVX512VBMI manually as autodetection does not get trigger, this causes test to fail src/fdr/teddy_fat.cpp: AVX512 loads need to be 64-bit aligned, caused a crash on clang-18
This commit is contained in:
committed by
GitHub
parent
7b505226ed
commit
7737104585
@@ -100,7 +100,7 @@ const m512 *getDupMaskBase(const struct Teddy *teddy, u8 numMask) {
|
||||
}
|
||||
|
||||
|
||||
const u8 ALIGN_AVX_DIRECTIVE p_mask_interleave[64] = {
|
||||
const u8 ALIGN_CL_DIRECTIVE p_mask_interleave[64] = {
|
||||
0, 32, 1, 33, 2, 34, 3, 35, 4, 36, 5, 37, 6, 38, 7, 39,
|
||||
8, 40, 9, 41, 10, 42, 11, 43, 12, 44, 13, 45, 14, 46, 15, 47,
|
||||
16, 48, 17, 49, 18, 50, 19, 51, 20, 52, 21, 53, 22, 54, 23, 55,
|
||||
|
||||
@@ -610,7 +610,9 @@ dstate_id_t find_sheng_states(dfa_info &info,
|
||||
for (auto v : sheng_states) {
|
||||
dstate_id_t s = g[v].index;
|
||||
if (contains(accel_escape_info, s)) {
|
||||
assert(!info.states[s].impl_id);
|
||||
if (info.states[s].impl_id == 0) {
|
||||
DEBUG_PRINTF("impl_id == 0!\n");
|
||||
}
|
||||
info.states[s].impl_id = sheng_end++;
|
||||
info.extra[s].sheng_id = info.states[s].impl_id - 1;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,11 @@ void q_skip_forward_to(struct mq *q, s64a min_loc) {
|
||||
// Dump the contents of the given queue.
|
||||
static never_inline UNUSED
|
||||
void debugQueue(const struct mq *q) {
|
||||
#ifdef __cplusplus
|
||||
if (q == nullptr) {
|
||||
#else
|
||||
if (q == NULL) {
|
||||
#endif
|
||||
DEBUG_PRINTF("q=NULL!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ vector<flat_set<NFAVertex>> gatherSuccessorsByDepth(const NGHolder &g,
|
||||
if (v == succr) {
|
||||
continue;
|
||||
}
|
||||
DEBUG_PRINTF("Node %zu depth %u\n", g[succ].index, d + 1);
|
||||
DEBUG_PRINTF("Node %zu depth %u\n", g[succr].index, d + 1);
|
||||
next.insert(succr);
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ vector<flat_set<NFAVertex>> gatherPredecessorsByDepth(const NGHolder &g,
|
||||
if (v == predc) {
|
||||
continue;
|
||||
}
|
||||
DEBUG_PRINTF("Node %zu depth %u\n", g[pred].index, d + 1);
|
||||
DEBUG_PRINTF("Node %zu depth %u\n", g[predc].index, d + 1);
|
||||
next.insert(predc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,8 +207,7 @@ vector<RoseLongLitHashEntry> buildHashTable(
|
||||
u32 lit_id = lit_offset.first;
|
||||
u32 offset = lit_offset.second;
|
||||
|
||||
DEBUG_PRINTF("hash 0x%08x lit_id %u offset %u bucket %u\n", hash,
|
||||
lit_id, offset, bucket);
|
||||
DEBUG_PRINTF("hash 0x%08x lit_id %u offset %u bucket %u\n", m.first, lit_id, offset, bucket);
|
||||
|
||||
auto &entry = tab[bucket];
|
||||
entry.str_offset = verify_u32(litToOffsetVal.at(lit_id));
|
||||
|
||||
@@ -1089,6 +1089,7 @@ hs_error_t HS_CDECL hs_stream_size(const hs_database_t *db,
|
||||
// perusal.
|
||||
static UNUSED
|
||||
void dumpData(const char *data, size_t len) {
|
||||
if (!data) return;
|
||||
DEBUG_PRINTF("BUFFER:");
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
u8 c = data[i];
|
||||
|
||||
Reference in New Issue
Block a user