ElectricFence found this bug where we were reading past the vector boundary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7585 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman 2003-08-04 23:48:40 +00:00
parent 27615d7f21
commit 3683d9e842

View File

@ -243,7 +243,7 @@ void InstrRUsage::addUsageDelta(const InstrRUsageDelta &delta) {
// for that resource in each cycle.
std::vector<resourceId_t>& rvec = this->resourcesByCycle[c];
int r;
for (r = (int) rvec.size(); r >= 0; r--)
for (r = rvec.size() - 1; r >= 0; r--)
if (rvec[r] == delta.resourceId)
{// found last entry for the resource
rvec.erase(rvec.begin() + r);