mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Merge remote-tracking branch 'origin/develop' into bugFix317
This commit is contained in:
commit
e343dd1662
@ -3,6 +3,7 @@ knownConditionTrueFalse:*Parser.rl
|
||||
knownConditionTrueFalse:*Parser.cpp
|
||||
variableScope:*Parser.rl
|
||||
unreadVariable:*control_verbs.cpp
|
||||
*:*simde/*
|
||||
assertWithSideEffect
|
||||
syntaxError
|
||||
internalError
|
||||
|
@ -431,6 +431,7 @@ accel_dfa_build_strat::buildAccel(UNUSED dstate_id_t this_idx,
|
||||
|
||||
DEBUG_PRINTF("accelerations scheme has offset s%u/d%u\n", info.offset,
|
||||
info.double_offset);
|
||||
// cppcheck-suppress redundantInitialization
|
||||
accel->generic.offset = verify_u8(info.offset);
|
||||
|
||||
if (double_byte_ok(info) && info.double_cr.none() &&
|
||||
|
@ -331,6 +331,7 @@ void buildReachMapping(const build_info &args, vector<NFAStateSet> &reach,
|
||||
vector<NFAVertex> verts;
|
||||
verts.reserve(args.num_states);
|
||||
auto sidat = [&state_ids=state_ids](const NFAVertex &v) {
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
return (state_ids.at(v) != NO_STATE);
|
||||
};
|
||||
const auto &vr = vertices_range(h);
|
||||
@ -921,11 +922,13 @@ void buildAccel(const build_info &args, NFAStateSet &accelMask,
|
||||
|
||||
// Start with the NONE case.
|
||||
auxvec.emplace_back(AccelAux());
|
||||
// cppcheck-suppress memsetClassFloat
|
||||
memset(&auxvec[0], 0, sizeof(AccelAux));
|
||||
auxvec[0].accel_type = ACCEL_NONE; // no states on.
|
||||
|
||||
AccelAux aux;
|
||||
for (u32 i = 1; i < accelCount; i++) {
|
||||
// cppcheck-suppress memsetClassFloat
|
||||
memset(&aux, 0, sizeof(aux));
|
||||
|
||||
NFAStateSet effective_states(args.num_states);
|
||||
@ -1218,10 +1221,11 @@ bool hasSquashableInitDs(const build_info &args) {
|
||||
static
|
||||
bool hasInitDsStates(const NGHolder &h,
|
||||
const unordered_map<NFAVertex, u32> &state_ids) {
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (state_ids.at(h.startDs) != NO_STATE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (is_triggered(h) && state_ids.at(h.start) != NO_STATE) {
|
||||
return true;
|
||||
}
|
||||
@ -1696,7 +1700,7 @@ static
|
||||
bool cannotDie(const build_info &args) {
|
||||
const auto &h = args.h;
|
||||
const auto &state_ids = args.state_ids;
|
||||
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
// If we have a startDs we're actually using, we can't die.
|
||||
if (state_ids.at(h.startDs) != NO_STATE) {
|
||||
DEBUG_PRINTF("is using startDs\n");
|
||||
|
@ -512,6 +512,7 @@ set<NFAVertex> findZombies(const NGHolder &h,
|
||||
}
|
||||
|
||||
for (const auto &v : inv_adjacent_vertices_range(h.accept, h)) {
|
||||
// cppcheck-suppress knownConditionTrueFalse
|
||||
if (state_ids.at(v) != NO_STATE) {
|
||||
zombies.insert(v);
|
||||
}
|
||||
|
@ -262,6 +262,7 @@ static
|
||||
bool hasSuffixLiterals(const set<ue2_literal> &s) {
|
||||
for (auto it = s.begin(), ite = s.end(); it != ite; ++it) {
|
||||
for (auto jt = std::next(it); jt != ite; ++jt) {
|
||||
// cppcheck-suppress useStlAlgorithm
|
||||
if (isSuffix(*it, *jt) || isSuffix(*jt, *it)) {
|
||||
DEBUG_PRINTF("'%s' and '%s' have suffix issues\n",
|
||||
dumpString(*it).c_str(),
|
||||
@ -530,7 +531,7 @@ void findMinCut(LitGraph &lg, vector<LitEdge> &cutset) {
|
||||
vector<s32> distances(num_verts);
|
||||
vector<LitEdge> predecessors(num_verts);
|
||||
vector<u64a> residuals(num_edges(lg));
|
||||
|
||||
//cppcheck-suppress unreadVariable
|
||||
UNUSED u64a flow = boykov_kolmogorov_max_flow(lg,
|
||||
get(&LitGraphEdgeProps::score, lg),
|
||||
make_iterator_property_map(residuals.begin(), e_index_map),
|
||||
|
@ -2018,8 +2018,7 @@ void buildCountingMiracles(build_context &bc) {
|
||||
continue;
|
||||
}
|
||||
|
||||
RoseCountingMiracle rcm;
|
||||
memset(&rcm, 0, sizeof(rcm));
|
||||
RoseCountingMiracle rcm = {}; // Initialize rcm to zero
|
||||
|
||||
if (cr.count() == 1) {
|
||||
rcm.c = cr.find_first();
|
||||
@ -3299,7 +3298,7 @@ void addEodAnchorProgram(const RoseBuildImpl &build, const build_context &bc,
|
||||
}
|
||||
|
||||
static
|
||||
void addEodEventProgram(const RoseBuildImpl &build, build_context &bc,
|
||||
void addEodEventProgram(const RoseBuildImpl &build,const build_context &bc,
|
||||
ProgramBuild &prog_build, RoseProgram &program) {
|
||||
if (build.eod_event_literal_id == MO_INVALID_IDX) {
|
||||
return;
|
||||
@ -3336,7 +3335,7 @@ void addEodEventProgram(const RoseBuildImpl &build, build_context &bc,
|
||||
}
|
||||
|
||||
static
|
||||
RoseProgram makeEodProgram(const RoseBuildImpl &build, build_context &bc,
|
||||
RoseProgram makeEodProgram(const RoseBuildImpl &build,const build_context &bc,
|
||||
ProgramBuild &prog_build, u32 eodNfaIterOffset) {
|
||||
RoseProgram program;
|
||||
|
||||
|
@ -2223,6 +2223,7 @@ void mergeCluster(RoseGraph &g, const ReportManager &rm,
|
||||
for (it2 = it;
|
||||
it2 != vcluster.end() && cluster.size() < MERGE_GROUP_SIZE_MAX;
|
||||
++it2) {
|
||||
// cppcheck-suppress derefInvalidIteratorRedundantCheck
|
||||
RoseVertex v = *it2;
|
||||
NGHolder *h = g[v].suffix.graph.get();
|
||||
assert(!g[v].suffix.haig); /* should not be here if haig */
|
||||
|
@ -127,6 +127,7 @@ static really_really_inline
|
||||
m128 lshift64_m128(m128 a, unsigned b) {
|
||||
#if defined(HAVE__BUILTIN_CONSTANT_P)
|
||||
if (__builtin_constant_p(b)) {
|
||||
// cppcheck-suppress unsignedLessThanZero
|
||||
return _mm_slli_epi64(a, b);
|
||||
}
|
||||
#endif
|
||||
|
@ -339,7 +339,7 @@ really_inline SuperVector<16> SuperVector<16>::vshl_16 (uint8_t const N) const
|
||||
if (N == 0) return *this;
|
||||
if (N == 16) return Zeroes();
|
||||
SuperVector result;
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { constexpr uint8_t n = i.value; if (N == n) result = {SuperVector<16>(_mm_slli_epi16(v->u.v128[0], n))}; });
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { if (N == i.value) result = {SuperVector<16>(_mm_slli_epi16(v->u.v128[0], i.value))}; });
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ really_inline SuperVector<16> SuperVector<16>::vshl_32 (uint8_t const N) const
|
||||
if (N == 0) return *this;
|
||||
if (N == 16) return Zeroes();
|
||||
SuperVector result;
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { constexpr uint8_t n = i.value; if (N == n) result = {SuperVector<16>(_mm_slli_epi32(v->u.v128[0], n))}; });
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { if (N == i.value) result = {SuperVector<16>(_mm_slli_epi32(v->u.v128[0], i.value))}; });
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -369,7 +369,7 @@ really_inline SuperVector<16> SuperVector<16>::vshl_64 (uint8_t const N) const
|
||||
if (N == 0) return *this;
|
||||
if (N == 16) return Zeroes();
|
||||
SuperVector result;
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { constexpr uint8_t n = i.value; if (N == n) result = {SuperVector<16>(_mm_slli_epi64(v->u.v128[0], n))}; });
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { if (N == i.value) result = {SuperVector<16>(_mm_slli_epi64(v->u.v128[0], i.value))}; });
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -384,7 +384,7 @@ really_inline SuperVector<16> SuperVector<16>::vshl_128(uint8_t const N) const
|
||||
if (N == 0) return *this;
|
||||
if (N == 16) return Zeroes();
|
||||
SuperVector result;
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { constexpr uint8_t n = i.value; if (N == n) result = {SuperVector<16>(_mm_slli_si128(v->u.v128[0], n))}; });
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { if (N == i.value) result = {SuperVector<16>(_mm_slli_si128(v->u.v128[0], i.value))}; });
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -414,7 +414,7 @@ really_inline SuperVector<16> SuperVector<16>::vshr_16 (uint8_t const N) const
|
||||
if (N == 0) return *this;
|
||||
if (N == 16) return Zeroes();
|
||||
SuperVector result;
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { constexpr uint8_t n = i.value; if (N == n) result = {SuperVector<16>(_mm_srli_epi16(v->u.v128[0], n))}; });
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { if (N == i.value) result = {SuperVector<16>(_mm_srli_epi16(v->u.v128[0], i.value))}; });
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ really_inline SuperVector<16> SuperVector<16>::vshr_32 (uint8_t const N) const
|
||||
if (N == 0) return *this;
|
||||
if (N == 16) return Zeroes();
|
||||
SuperVector result;
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { constexpr uint8_t n = i.value; if (N == n) result = {SuperVector<16>(_mm_srli_epi32(v->u.v128[0], n))}; });
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { if (N == i.value) result = {SuperVector<16>(_mm_srli_epi32(v->u.v128[0], i.value))}; });
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -444,7 +444,7 @@ really_inline SuperVector<16> SuperVector<16>::vshr_64 (uint8_t const N) const
|
||||
if (N == 0) return *this;
|
||||
if (N == 16) return Zeroes();
|
||||
SuperVector result;
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { constexpr uint8_t n = i.value; if (N == n) result = {SuperVector<16>(_mm_srli_epi64(v->u.v128[0], n))}; });
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { if (N == i.value) result = {SuperVector<16>(_mm_srli_epi64(v->u.v128[0], i.value))}; });
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -459,7 +459,7 @@ really_inline SuperVector<16> SuperVector<16>::vshr_128(uint8_t const N) const
|
||||
if (N == 0) return *this;
|
||||
if (N == 16) return Zeroes();
|
||||
SuperVector result;
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { constexpr uint8_t n = i.value; if (N == n) result = {SuperVector<16>(_mm_srli_si128(v->u.v128[0], n))}; });
|
||||
Unroller<1, 16>::iterator([&,v=this](auto const i) { if (N == i.value) result = {SuperVector<16>(_mm_srli_si128(v->u.v128[0], i.value))}; });
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -312,7 +312,7 @@ static
|
||||
string dbSettingsHash(const string &filename, u32 mode) {
|
||||
ostringstream info_oss;
|
||||
|
||||
info_oss << filename.c_str() << ' ';
|
||||
info_oss << filename << ' ';
|
||||
info_oss << mode << ' ';
|
||||
|
||||
string info = info_oss.str();
|
||||
|
@ -38,8 +38,8 @@ using namespace ue2;
|
||||
|
||||
TEST(Truffle, CompileDot) {
|
||||
m128 mask1, mask2;
|
||||
memset(&mask1, 0, sizeof(mask1));
|
||||
memset(&mask2, 0, sizeof(mask2));
|
||||
memset(&mask1, 0, sizeof(mask1)); // cppcheck-suppress memsetClassFloat
|
||||
memset(&mask2, 0, sizeof(mask2)); // cppcheck-suppress memsetClassFloat
|
||||
|
||||
CharReach chars;
|
||||
|
||||
@ -93,8 +93,8 @@ TEST(Truffle, CompileChars) {
|
||||
|
||||
TEST(Truffle, ExecNoMatch1) {
|
||||
m128 mask1, mask2;
|
||||
memset(&mask1, 0, sizeof(mask1));
|
||||
memset(&mask2, 0, sizeof(mask2));
|
||||
memset(&mask1, 0, sizeof(mask1)); // cppcheck-suppress memsetClassFloat
|
||||
memset(&mask2, 0, sizeof(mask2)); // cppcheck-suppress memsetClassFloat
|
||||
|
||||
CharReach chars;
|
||||
|
||||
|
@ -105,7 +105,7 @@ TEST(Uniform, loadstore_m128) {
|
||||
u32 words[128/32];
|
||||
} in;
|
||||
for (int i = 0; i < 128; i++) {
|
||||
memset(&in, 0, sizeof(in));
|
||||
memset(&in, 0, sizeof(in)); // cppcheck-suppress memsetClassFloat
|
||||
in.words[i/32] = 1U << (i % 32);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
m128 out = load_m128(cin);
|
||||
@ -123,7 +123,7 @@ TEST(Uniform, loadstore_m256) {
|
||||
u32 words[256/32];
|
||||
} in;
|
||||
for (int i = 0; i < 256; i++) {
|
||||
memset(&in, 0, sizeof(in));
|
||||
memset(&in, 0, sizeof(in)); // cppcheck-suppress memsetClassFloat
|
||||
in.words[i/32] = 1U << (i % 32);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
m256 out = load_m256(cin);
|
||||
@ -141,7 +141,7 @@ TEST(Uniform, loadstore_m512) {
|
||||
u32 words[512/32];
|
||||
} in;
|
||||
for (int i = 0; i < 512; i++) {
|
||||
memset(&in, 0, sizeof(in));
|
||||
memset(&in, 0, sizeof(in)); // cppcheck-suppress memsetClassFloat
|
||||
in.words[i/32] = 1U << (i % 32);
|
||||
const char *cin = reinterpret_cast<const char *>(&in);
|
||||
m512 out = load_m512(cin);
|
||||
|
Loading…
x
Reference in New Issue
Block a user