From a2b8a8a451e09618556f031303b3ad0c09a89228 Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Thu, 21 Mar 2024 21:20:06 +0100 Subject: [PATCH] Move check --- lib/valueflow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index c2d1784cd0f..ab861b58298 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -4971,7 +4971,9 @@ static void valueFlowLifetime(TokenList &tokenlist, ErrorLogger *errorLogger, co valueFlowForwardLifetime(tok, tokenlist, errorLogger, settings); } // address of - else if (tok->isUnaryOp("&") && !Token::simpleMatch(tok->astParent(), "*")) { + else if (tok->isUnaryOp("&")) { + if (Token::simpleMatch(tok->astParent(), "*")) + continue; for (const ValueFlow::LifetimeToken& lt : ValueFlow::getLifetimeTokens(tok->astOperand1())) { if (!settings.certainty.isEnabled(Certainty::inconclusive) && lt.inconclusive) continue;