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")
|
||||
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%"))
|
||||
tok = tok->next();
|
||||
else
|
||||
|
|
|
@ -1234,6 +1234,11 @@ private:
|
|||
" if (std::find(a,b,c) != c) { }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #3714 - segmentation fault for syntax error
|
||||
check("void f() {\n"
|
||||
" if (()) { }\n"
|
||||
"}");
|
||||
}
|
||||
|
||||
void if_str_find() {
|
||||
|
|
Loading…
Reference in New Issue