Examples of errors detected by the V539 diagnostic


V539. Consider inspecting iterators which are being passed as arguments to function 'Foo'.


CryEngine V

V539 Consider inspecting iterators which are being passed as arguments to function 'erase'. frameprofilerender.cpp 1090


float CFrameProfileSystem::RenderPeaks()
{
  ....
  std::vector<SPeakRecord>& rPeaks = m_peaks;

  // Go through all peaks.
  for (int i = 0; i < (int)rPeaks.size(); i++)
  {
    ....
    if (age > fHotToColdTime)
    {
      rPeaks.erase(m_peaks.begin() + i); // <=
      i--;
    }
    ....
  }
  ....
}


Bugs Found

Checked Projects
334
Collected Errors
12 668