Fix crash
This commit is contained in:
parent
f4327f5e45
commit
41a64f6d1f
|
@ -172,6 +172,18 @@ void CheckFunctions::checkIgnoredReturnValue()
|
|||
tok = tok->link();
|
||||
}
|
||||
|
||||
if (Token::simpleMatch(tok, ") (") && Token::Match(tok->link()->previous(), "%name% (")) {
|
||||
while (tok && tok->str() != ";") {
|
||||
if (Token::Match(tok, "(|["))
|
||||
tok = tok->link();
|
||||
else
|
||||
tok = tok->next();
|
||||
}
|
||||
if (!tok)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tok->varId() || !Token::Match(tok, "%name% ("))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -918,6 +918,11 @@ private:
|
|||
" DEBUG(x(); mystrcmp(a,b););\n"
|
||||
"}", "test.cpp", &settings2);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void foo() {\n" // don't crash
|
||||
" DEBUG(123)(mystrcmp(a,b))(fd);\n"
|
||||
"}", "test.c", &settings2);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue