Skip to content

Commit deef464

Browse files
committed
Buffer overrun: removed some old code that is not based on valueflow
1 parent e5301b2 commit deef464

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

‎lib/checkbufferoverrun.cpp‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -971,17 +971,6 @@ void CheckBufferOverrun::checkScope(const Token *tok, const std::vector<std::str
971971
valueFlowCheckArrayIndex(tok2, arrayInfo);
972972
}
973973

974-
// Array index..
975-
if ((declarationId > 0 && Token::Match(tok, "%varid% [ %num% ]", declarationId)) ||
976-
(declarationId == 0 && Token::Match(tok, (varnames + " [ %num% ]").c_str()))) {
977-
const MathLib::bigint index = MathLib::toLongNumber(tok->strAt(2 + varc));
978-
if (index >= size) {
979-
std::vector<MathLib::bigint> indexes;
980-
indexes.push_back(index);
981-
arrayIndexOutOfBoundsError(tok->tokAt(varc), arrayInfo, indexes);
982-
}
983-
}
984-
985974
// If the result of pointer arithmetic means that the pointer is
986975
// out of bounds then this flag will be set.
987976
bool pointerIsOutOfBounds = false;

0 commit comments

Comments
 (0)