@@ -260,6 +260,7 @@ void Tokenizer::insertTokens(Token *dest, const Token *src, unsigned int n)
260260 dest->isBoolean (src->isBoolean ());
261261 dest->isUnsigned (src->isUnsigned ());
262262 dest->isSigned (src->isSigned ());
263+ dest->isPointerCompare (src->isPointerCompare ());
263264 dest->isLong (src->isLong ());
264265 dest->isUnused (src->isUnused ());
265266 src = src->next ();
@@ -284,6 +285,7 @@ Token *Tokenizer::copyTokens(Token *dest, const Token *first, const Token *last)
284285 tok2->isBoolean (tok->isBoolean ());
285286 tok2->isUnsigned (tok->isUnsigned ());
286287 tok2->isSigned (tok->isSigned ());
288+ tok2->isPointerCompare (tok->isPointerCompare ());
287289 tok2->isLong (tok->isLong ());
288290 tok2->isUnused (tok->isUnused ());
289291 tok2->varId (tok->varId ());
@@ -6477,17 +6479,21 @@ void Tokenizer::simplifyIfNotNull()
64776479 Token::Match (tok, " 0 != %var%" ))
64786480 {
64796481 deleteFrom = tok->previous ();
6482+ if (tok->tokAt (2 ))
6483+ tok->tokAt (2 )->isPointerCompare (true );
64806484 }
64816485
64826486 else if (Token::Match (tok, " %var% != 0" ))
64836487 {
64846488 deleteFrom = tok;
6489+ tok->isPointerCompare (true );
64856490 }
64866491
64876492 else if (Token::Match (tok, " %var% .|:: %var% != 0" ))
64886493 {
64896494 tok = tok->tokAt (2 );
64906495 deleteFrom = tok;
6496+ tok->isPointerCompare (true );
64916497 }
64926498 }
64936499
0 commit comments