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 103b70b8d0
commit 2b76edee4a
4 changed files with 3 additions and 37 deletions

View File

@@ -206,10 +206,6 @@ void makeCFG_top_edge(GoughGraph &cfg, const vector<GoughVertex> &vertices,
assert(contains(src_slots, slot_id));
shared_ptr<GoughSSAVarMin> vmin = make_shared<GoughSSAVarMin>();
if (!vmin) {
assert(0);
throw std::bad_alloc();
}
cfg[e].vars.emplace_back(vmin);
final_var = vmin.get();
@@ -321,10 +317,6 @@ void makeCFG_edge(GoughGraph &cfg, const map<u32, u32> &som_creators,
DEBUG_PRINTF("bypassing min on join %u\n", slot_id);
} else {
shared_ptr<GoughSSAVarMin> vmin = make_shared<GoughSSAVarMin>();
if (!vmin) {
assert(0);
throw std::bad_alloc();
}
cfg[e].vars.emplace_back(vmin);
final_var = vmin.get();