Skip to content

Commit c8642a7

Browse files
committed
astutils.cpp: added more bailouts in isMutableExpression() [skip ci]
1 parent 50adc67 commit c8642a7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/astutils.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,6 +2479,12 @@ bool isMutableExpression(const Token* tok)
24792479
return false;
24802480
if (tok->isLiteral() || tok->isKeyword() || tok->isStandardType() || tok->isEnumerator())
24812481
return false;
2482+
if (Token::Match(tok, "std :: %name%"))
2483+
return false;
2484+
if (Token::Match(tok->previous(), "std :: %name%"))
2485+
return false;
2486+
if (Token::Match(tok->tokAt(-2), "std :: %name%"))
2487+
return false;
24822488
if (Token::Match(tok, ",|;|:|]|)|}"))
24832489
return false;
24842490
if (Token::simpleMatch(tok, "[ ]"))
@@ -2887,6 +2893,8 @@ const Token* findEscapeStatement(const Scope* scope, const Library& library)
28872893
return nullptr;
28882894
}
28892895

2896+
#include <iostream>
2897+
28902898
template<class F,
28912899
REQUIRES("F must be a function that returns a Token class",
28922900
std::is_convertible<decltype(std::declval<F>()()), const Token*> )>
@@ -2920,7 +2928,10 @@ static bool isExpressionChangedAt(const F& getExprTok,
29202928
if (!expr && !(tok->valueType() && tok->valueType()->pointer == 0 && tok->valueType()->reference == Reference::None))
29212929
aliased = true;
29222930
if (!aliased)
2931+
{
2932+
std::cout << tok->str() << " " << tok->exprId() << " " << exprid << " " << indirect << std::endl;
29232933
aliased = isAliasOf(tok, expr, &i);
2934+
}
29242935
if (!aliased)
29252936
return false;
29262937
if (isVariableChanged(tok, indirect + i, settings, depth))

0 commit comments

Comments
 (0)