Fixed #8232 (segmentation fault on valid C++ code in isOppositeCond())
This commit is contained in:
parent
361ae311f6
commit
3a8bdad20a
|
@ -391,6 +391,9 @@ static bool iscast(const Token *tok)
|
||||||
if (!Token::Match(tok, "( ::| %name%"))
|
if (!Token::Match(tok, "( ::| %name%"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (Token::simpleMatch(tok->link(), ") ( )"))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (tok->previous() && tok->previous()->isName() && tok->previous()->str() != "return")
|
if (tok->previous() && tok->previous()->isName() && tok->previous()->str() != "return")
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -8500,6 +8500,7 @@ private:
|
||||||
// not cast
|
// not cast
|
||||||
ASSERT_EQUALS("AB||", testAst("(A)||(B)"));
|
ASSERT_EQUALS("AB||", testAst("(A)||(B)"));
|
||||||
ASSERT_EQUALS("abc[1&=", testAst("a = (b[c]) & 1;"));
|
ASSERT_EQUALS("abc[1&=", testAst("a = (b[c]) & 1;"));
|
||||||
|
ASSERT_EQUALS("abc::(=", testAst("a = (b::c)();"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void astlambda() {
|
void astlambda() {
|
||||||
|
|
Loading…
Reference in New Issue