Fixed #2582 (segmentation fault of cppcheck ( if() ))
This commit is contained in:
parent
0e34b8bee5
commit
9a760b9654
|
@ -554,7 +554,7 @@ void CheckNullPointer::nullPointerByCheckAndDeRef()
|
|||
{
|
||||
// goto the end paranthesis
|
||||
const Token *endpar = tok->next()->link();
|
||||
const Token *endbody = endpar ? endpar->next()->link() : 0;
|
||||
const Token *endbody = Token::simpleMatch(endpar, ") {") ? endpar->next()->link() : 0;
|
||||
if (endbody &&
|
||||
Token::Match(endbody->tokAt(-3), "[;{}] %var% ;") &&
|
||||
isUpper(endbody->tokAt(-2)->str()))
|
||||
|
|
|
@ -890,6 +890,9 @@ private:
|
|||
" };\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #2582 - segmentation fault
|
||||
check("if()");
|
||||
}
|
||||
|
||||
// Test CheckNullPointer::nullConstantDereference
|
||||
|
|
Loading…
Reference in New Issue