diff --git a/src/mem/cache/replacement_policies/tree_plru_rp.cc b/src/mem/cache/replacement_policies/tree_plru_rp.cc index ffd039c9e1..2766916534 100644 --- a/src/mem/cache/replacement_policies/tree_plru_rp.cc +++ b/src/mem/cache/replacement_policies/tree_plru_rp.cc @@ -104,7 +104,8 @@ TreePLRU::TreePLRUReplData::TreePLRUReplData( TreePLRU::TreePLRU(const Params &p) : Base(p), numLeaves(p.num_leaves), count(0), treeInstance(nullptr) { - fatal_if(numLeaves < 2, "Number of leaves must be two or greater"); + fatal_if(numLeaves < 1, + "numLeaves should never be 0"); } void @@ -191,7 +192,7 @@ TreePLRU::getVictim(const ReplacementCandidates& candidates) const // The tree index is currently at the leaf of the victim displaced by the // number of non-leaf nodes - return candidates[tree_index - (numLeaves - 1)]; + return candidates.at(tree_index - (numLeaves - 1)); } std::shared_ptr