From 539258f7a3618cde129502cf8e72a1b0e6050484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 22 Oct 2017 23:13:12 +0200 Subject: [PATCH] Fix FP for pointer addition checker --- lib/checkcondition.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index dd21fa328..e4555622b 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -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();