Skip to content

Commit 8b8ca9c

Browse files
committed
astutils.cpp: added missing nullptr checks
1 parent 9881f86 commit 8b8ca9c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/astutils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2625,6 +2625,8 @@ static bool hasOverloadedMemberAccess(const Token* tok)
26252625

26262626
bool isVariableChanged(const Token *tok, int indirect, const Settings &settings, int depth)
26272627
{
2628+
if (!tok)
2629+
return false;
26282630
if (!tok->isMutableExpr())
26292631
return false;
26302632

@@ -2917,6 +2919,8 @@ static bool isExpressionChangedAt(const F& getExprTok,
29172919
{
29182920
if (depth < 0)
29192921
return true;
2922+
if (!tok)
2923+
return false;
29202924
if (!tok->isMutableExpr())
29212925
return false;
29222926
if (tok->exprId() != exprid || (!tok->varId() && !tok->isName())) {

0 commit comments

Comments
 (0)