Fix known conditions

This commit is contained in:
Paul 2020-06-25 15:46:30 -05:00
parent 1676ad5f45
commit 60c42b17a6
1 changed files with 3 additions and 3 deletions

View File

@ -1369,11 +1369,11 @@ bool isVariableChangedByFunctionCall(const Token *tok, int indirect, const Setti
return false; return false;
} }
if (addressOf || (indirect > 0 && arg && arg->isPointer())) { if (addressOf || (indirect > 0 && arg->isPointer())) {
if (!(arg && arg->isConst())) if (!arg->isConst())
return true; return true;
// If const is applied to the pointer, then the value can still be modified // If const is applied to the pointer, then the value can still be modified
if (arg && Token::simpleMatch(arg->typeEndToken(), "* const")) if (Token::simpleMatch(arg->typeEndToken(), "* const"))
return true; return true;
} }