Merge pull request #575 from Dmitry-Me/avoidIntegerTruncation

Avoid value truncation
This commit is contained in:
Daniel Marjamäki 2015-03-25 09:58:42 +01:00
commit 9846ff10b2
1 changed files with 1 additions and 1 deletions

View File

@ -1736,7 +1736,7 @@ Check::FileInfo* CheckBufferOverrun::getFileInfo(const Tokenizer *tokenizer, con
tok->next()->astOperand2()) {
const ValueFlow::Value *value = tok->next()->astOperand2()->getMaxValue(false);
if (value && value->intvalue > 0) {
const int arrayIndex = value->intvalue;
const MathLib::bigint arrayIndex = value->intvalue;
std::map<std::string, struct MyFileInfo::ArrayUsage>::iterator it = fileInfo->arrayUsage.find(tok->str());
if (it != fileInfo->arrayUsage.end() && it->second.index >= arrayIndex)
continue;