mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
klocwork: fix risk issues
This commit is contained in:
committed by
Konstantinos Margaritis
parent
75dbedeebe
commit
978105a4c0
@@ -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();
|
||||
|
||||
|
@@ -124,6 +124,10 @@ RepeatStateInfo::RepeatStateInfo(enum RepeatType type, const depth &repeatMin,
|
||||
const depth &repeatMax, u32 minPeriod)
|
||||
: stateSize(0), packedCtrlSize(0), horizon(0), patchCount(0),
|
||||
patchSize(0), encodingSize(0), patchesOffset(0) {
|
||||
if (type == REPEAT_SPARSE_OPTIMAL_P && minPeriod == 0) {
|
||||
assert(0);
|
||||
throw std::domain_error("SPARSE_OPTIMAL_P must have non-zero minPeriod.");
|
||||
}
|
||||
assert(repeatMin <= repeatMax);
|
||||
assert(repeatMax.is_reachable());
|
||||
assert(minPeriod || type != REPEAT_SPARSE_OPTIMAL_P);
|
||||
|
Reference in New Issue
Block a user