klocwork: fix risk issues

This commit is contained in:
Hong, Yang A
2022-05-31 06:30:18 +00:00
committed by Konstantinos Margaritis
parent 88a1048ae7
commit 2d521d64a2
15 changed files with 61 additions and 10 deletions

View File

@@ -206,6 +206,10 @@ 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();
@@ -317,6 +321,10 @@ 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();