File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4072,12 +4072,16 @@ void CheckOther::checkComparePointers()
40724072 if (!Token::Match (tok, " <|>|<=|>=|-" ))
40734073 continue ;
40744074 const Token *tok1 = tok->astOperand1 ();
4075+ if (!astIsPointer (tok1))
4076+ continue ;
40754077 const Token *tok2 = tok->astOperand2 ();
4076- if (!astIsPointer (tok1) || ! astIsPointer ( tok2))
4078+ if (!astIsPointer (tok2))
40774079 continue ;
40784080 ValueFlow::Value v1 = ValueFlow::getLifetimeObjValue (tok1);
4081+ if (!v1.isLocalLifetimeValue ())
4082+ continue ;
40794083 ValueFlow::Value v2 = ValueFlow::getLifetimeObjValue (tok2);
4080- if (!v1. isLocalLifetimeValue () || ! v2.isLocalLifetimeValue ())
4084+ if (!v2.isLocalLifetimeValue ())
40814085 continue ;
40824086 const Variable *var1 = v1.tokvalue ->variable ();
40834087 const Variable *var2 = v2.tokvalue ->variable ();
You can’t perform that action at this time.
0 commit comments