Avoid value truncation
This commit is contained in:
parent
be4e51f00b
commit
9398fa810b
|
@ -1736,7 +1736,7 @@ Check::FileInfo* CheckBufferOverrun::getFileInfo(const Tokenizer *tokenizer, con
|
||||||
tok->next()->astOperand2()) {
|
tok->next()->astOperand2()) {
|
||||||
const ValueFlow::Value *value = tok->next()->astOperand2()->getMaxValue(false);
|
const ValueFlow::Value *value = tok->next()->astOperand2()->getMaxValue(false);
|
||||||
if (value && value->intvalue > 0) {
|
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());
|
std::map<std::string, struct MyFileInfo::ArrayUsage>::iterator it = fileInfo->arrayUsage.find(tok->str());
|
||||||
if (it != fileInfo->arrayUsage.end() && it->second.index >= arrayIndex)
|
if (it != fileInfo->arrayUsage.end() && it->second.index >= arrayIndex)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue