diff --git a/regex/hwlm/noodle_engine_avx2.c b/regex/hwlm/noodle_engine_avx2.c index 5edc646af..2a42a3c0e 100644 --- a/regex/hwlm/noodle_engine_avx2.c +++ b/regex/hwlm/noodle_engine_avx2.c @@ -114,13 +114,17 @@ hwlm_error_t scanSingleShort(const struct noodTable *n, const u8 *buf, } m256 v; - if (l < 4) { u8 *vp = (u8*)&v; switch (l) { - case 3: vp[2] = d[2]; // fallthrough - case 2: vp[1] = d[1]; // fallthrough - case 1: vp[0] = d[0]; // fallthrough + case 3: + vp[2] = d[2]; // fallthrough + fallthrough; + case 2: + vp[1] = d[1]; // fallthrough + fallthrough; + case 1: + vp[0] = d[0]; // fallthrough } } else { v = masked_move256_len(d, l); @@ -154,16 +158,23 @@ hwlm_error_t scanDoubleShort(const struct noodTable *n, const u8 *buf, m256 v; DEBUG_PRINTF("d %zu\n", d - buf); + if (l < 4) { u8 *vp = (u8*)&v; switch (l) { - case 3: vp[2] = d[2]; // fallthrough - case 2: vp[1] = d[1]; // fallthrough - case 1: vp[0] = d[0]; // fallthrough + case 3: + vp[2] = d[2]; // fallthrough + fallthrough; + case 2: + vp[1] = d[1]; // fallthrough + fallthrough; + case 1: + vp[0] = d[0]; // fallthrough } } else { v = masked_move256_len(d, l); } + if (noCase) { v = and256(v, caseMask); } diff --git a/regex/runtime.c b/regex/runtime.c index 54ee2fd8e..b7c17320e 100644 --- a/regex/runtime.c +++ b/regex/runtime.c @@ -1224,7 +1224,7 @@ hs_error_t HS_CDECL hs_scan_tfwstr(const hs_database_t *db, TFW_STR_FOR_EACH_CHUNK(chunk, str, end) { - DEBUG_PRINTF("offset=%llu len=%u\n", chunk->data, chunk->len); + DEBUG_PRINTF("offset=%llu len=%lu\n", id->offset, chunk->len); #ifdef DEBUG dumpData(chunk->data, chunk->len); #endif diff --git a/scripts/regex_start.sh b/scripts/regex_start.sh index 554f5bbfe..18f532924 100755 --- a/scripts/regex_start.sh +++ b/scripts/regex_start.sh @@ -10,7 +10,8 @@ for filename in ${tmp_path}/*.txt; do rm -rf ${tmp_path}/out/ && mkdir ${tmp_path}/out #${script_path}/hscollider -e ${filename} -ao ${tmp_path}/out/ -n1 #this version for single block strings - ${script_path}/hscollider -e ${filename} -V5 -ao ${tmp_path}/out/ -n1 + #${script_path}/hscollider -e ${filename} -V5 -ao ${tmp_path}/out/ -n1 #this version starts hscollider from scripts directory + hscollider -e ${filename} -V5 -ao ${tmp_path}/out/ -n1 mkdir $db_path dd if=$(echo ${tmp_path}/out/*.db) of=${db_path}/database