Skip to content

Commit 06739d1

Browse files
Update checkfunctions.cpp
1 parent 1516cd2 commit 06739d1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎lib/checkfunctions.cpp‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,15 @@ void CheckFunctionsImpl::invalidFunctionArgError(const Token *tok, const std::st
222222
errmsg << " The value is " << std::setprecision(10) << (invalidValue->isIntValue() ? invalidValue->intvalue : invalidValue->floatValue) << " but the valid values are '" << validstr << "'.";
223223
else
224224
errmsg << " The value is 0 or 1 (boolean) but the valid values are '" << validstr << "'.";
225-
if (invalidValue)
225+
if (invalidValue) {
226+
const auto severity = invalidValue->errorSeverity() && invalidValue->isKnown() && !invalidValue->conditional ? Severity::error : Severity::warning;
226227
reportError(getErrorPath(tok, invalidValue, "Invalid argument"),
227-
invalidValue->errorSeverity() && invalidValue->isKnown() ? Severity::error : Severity::warning,
228+
severity,
228229
"invalidFunctionArg",
229230
errmsg.str(),
230231
CWE628,
231232
invalidValue->isInconclusive() ? Certainty::inconclusive : Certainty::normal);
232-
else
233+
} else
233234
reportError(tok,
234235
Severity::error,
235236
"invalidFunctionArg",

0 commit comments

Comments
 (0)