Skip to content

Commit 06aeac7

Browse files
committed
Bug hunting; Fix false negatives
1 parent b4443aa commit 06aeac7

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/exprengine.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,10 +1538,14 @@ static ExprEngine::ValuePtr executeFunctionCall(const Token *tok, Data &data)
15381538
return retVal;
15391539
}
15401540

1541+
const bool hasBody = tok->astOperand1()->function() && tok->astOperand1()->function()->hasBody();
1542+
15411543
std::vector<ExprEngine::ValuePtr> argValues;
15421544
for (const Token *argtok : getArguments(tok)) {
1543-
auto val = executeExpression1(argtok, data);
1545+
auto val = hasBody ? executeExpression1(argtok, data) : executeExpression(argtok, data);
15441546
argValues.push_back(val);
1547+
if (hasBody)
1548+
continue;
15451549
if (!argtok->valueType() || (argtok->valueType()->constness & 1) == 1)
15461550
continue;
15471551
if (auto arrayValue = std::dynamic_pointer_cast<ExprEngine::ArrayValue>(val)) {

test/bug-hunting/itc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ def get_error_lines(filename):
4242
linenr = 242 # warn about usage
4343
elif linenr == 266:
4444
continue # no warning should be written
45-
elif linenr == 295:
46-
continue # FIXME: False negative
4745
ret.append(linenr)
4846
return ret
4947

0 commit comments

Comments
 (0)