Fix FP for pointer addition checker

This commit is contained in:
Daniel Marjamäki 2017-10-22 23:13:12 +02:00
parent 28cfee2d4f
commit 539258f7a3
1 changed files with 4 additions and 0 deletions

View File

@ -1357,6 +1357,10 @@ void CheckCondition::checkPointerAdditionResultNotNull()
if (!tok->isComparisonOp() || !tok->astOperand1() || !tok->astOperand2())
continue;
// Macros might have pointless safety checks
if (tok->isExpandedMacro())
continue;
const Token *calcToken, *exprToken;
if (tok->astOperand1()->str() == "+") {
calcToken = tok->astOperand1();