Bug hunting; Fix false negatives

This commit is contained in:
Daniel Marjamäki 2020-06-19 18:38:02 +02:00
parent b4443aa5a0
commit 06aeac75dc
2 changed files with 5 additions and 3 deletions

View File

@ -1538,10 +1538,14 @@ static ExprEngine::ValuePtr executeFunctionCall(const Token *tok, Data &data)
return retVal;
}
const bool hasBody = tok->astOperand1()->function() && tok->astOperand1()->function()->hasBody();
std::vector<ExprEngine::ValuePtr> argValues;
for (const Token *argtok : getArguments(tok)) {
auto val = executeExpression1(argtok, data);
auto val = hasBody ? executeExpression1(argtok, data) : executeExpression(argtok, data);
argValues.push_back(val);
if (hasBody)
continue;
if (!argtok->valueType() || (argtok->valueType()->constness & 1) == 1)
continue;
if (auto arrayValue = std::dynamic_pointer_cast<ExprEngine::ArrayValue>(val)) {

View File

@ -42,8 +42,6 @@ def get_error_lines(filename):
linenr = 242 # warn about usage
elif linenr == 266:
continue # no warning should be written
elif linenr == 295:
continue # FIXME: False negative
ret.append(linenr)
return ret