Fixed Cppcheck warning, possible null pointer dereference of tok.
This commit is contained in:
parent
a2f669eff7
commit
0a1a34b9b7
|
@ -2242,7 +2242,7 @@ static bool isWithoutSideEffects(const Tokenizer *tokenizer, const Token* tok)
|
|||
|
||||
while (tok && tok->astOperand2() && tok->astOperand2()->str() != "(")
|
||||
tok = tok->astOperand2();
|
||||
if (tok->varId()) {
|
||||
if (tok && tok->varId()) {
|
||||
const Variable* var = tok->variable();
|
||||
return var && (!var->isClass() || var->isPointer() || var->isStlType());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue