Fix marked as false positive knownConditionTrueFalse cppcheck warnings

std::make_shared<> does not return null, it throws std::bad_alloc.
This commit is contained in:
Konstantinos Margaritis
2024-05-12 18:40:51 +03:00
parent cd1e13d4d2
commit a1fbe84660
4 changed files with 3 additions and 37 deletions

View File

@@ -561,10 +561,7 @@ bool handleMixedPrefixCliche(const NGHolder &h, RoseGraph &g, RoseVertex v,
DEBUG_PRINTF("woot?\n");
shared_ptr<NGHolder> h_new = make_shared<NGHolder>();
if (!h_new) {
assert(0);
throw std::bad_alloc();
}
unordered_map<NFAVertex, NFAVertex> rhs_map;
vector<NFAVertex> exits_vec;
insert(&exits_vec, exits_vec.end(), exits);