Skip to content

Commit 303ef23

Browse files
committed
fixed #13734 - FP unsignedLessThanZero for unknown array size [skip ci]
1 parent 5a9d0b3 commit 303ef23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/symboldatabase.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -3747,13 +3747,15 @@ bool Variable::arrayDimensions(const Settings& settings, bool& isContainer)
37473747
// TODO: collect timing information for this call?
37483748
ValueFlow::valueFlowConstantFoldAST(const_cast<Token *>(dimension_.tok), settings);
37493749
if (dimension_.tok) {
3750-
if (const ValueFlow::Value* v = dimension_.tok->getKnownValue(ValueFlow::Value::ValueType::INT))
3750+
if (const ValueFlow::Value* v = dimension_.tok->getKnownValue(ValueFlow::Value::ValueType::INT)) {
37513751
dimension_.num = v->intvalue;
3752+
dimension_.known = true;
3753+
}
37523754
else if (dimension_.tok->isTemplateArg() && !dimension_.tok->values().empty()) {
37533755
assert(dimension_.tok->values().size() == 1);
37543756
dimension_.num = dimension_.tok->values().front().intvalue;
3757+
dimension_.known = true;
37553758
}
3756-
dimension_.known = true;
37573759
}
37583760
}
37593761
mDimensions.push_back(dimension_);

0 commit comments

Comments
 (0)