Fixed #3714 (segmentation fault of cppcheck checking libtiff)
This commit is contained in:
parent
3eede5ba8c
commit
c6ba3ba3ca
|
@ -731,7 +731,7 @@ void CheckStl::if_find()
|
||||||
if (tok->str() == "if")
|
if (tok->str() == "if")
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
|
|
||||||
for (const Token* const end = tok->link(); tok != end; tok = tok->next()) {
|
for (const Token* const end = tok->link(); tok != end; tok = (tok == end) ? end : tok->next()) {
|
||||||
if (Token::Match(tok, "&&|(|%oror%"))
|
if (Token::Match(tok, "&&|(|%oror%"))
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
else
|
else
|
||||||
|
|
|
@ -1234,6 +1234,11 @@ private:
|
||||||
" if (std::find(a,b,c) != c) { }\n"
|
" if (std::find(a,b,c) != c) { }\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// #3714 - segmentation fault for syntax error
|
||||||
|
check("void f() {\n"
|
||||||
|
" if (()) { }\n"
|
||||||
|
"}");
|
||||||
}
|
}
|
||||||
|
|
||||||
void if_str_find() {
|
void if_str_find() {
|
||||||
|
|
Loading…
Reference in New Issue