Buffer overrun: removed some old code that is not based on valueflow

This commit is contained in:
Daniel Marjamäki 2014-03-29 20:22:35 +01:00
parent e5301b2b7a
commit deef4642d4
1 changed files with 0 additions and 11 deletions

View File

@ -971,17 +971,6 @@ void CheckBufferOverrun::checkScope(const Token *tok, const std::vector<std::str
valueFlowCheckArrayIndex(tok2, arrayInfo);
}
// Array index..
if ((declarationId > 0 && Token::Match(tok, "%varid% [ %num% ]", declarationId)) ||
(declarationId == 0 && Token::Match(tok, (varnames + " [ %num% ]").c_str()))) {
const MathLib::bigint index = MathLib::toLongNumber(tok->strAt(2 + varc));
if (index >= size) {
std::vector<MathLib::bigint> indexes;
indexes.push_back(index);
arrayIndexOutOfBoundsError(tok->tokAt(varc), arrayInfo, indexes);
}
}
// If the result of pointer arithmetic means that the pointer is
// out of bounds then this flag will be set.
bool pointerIsOutOfBounds = false;