SymbolDatabase: Disable code for function pointers

This hopefully fixes all Travis crashes when running cppcheck:
[./test/Analysis/stack-addr-ps.c] (error) Internal error: Child process crashed with signal 11 [cppcheckError]
[./test/Index/complete-pointer-and-reference-to-functions.cpp] (error) Internal error: Child process crashed with signal 11 [cppcheckError]
[./test/SemaCXX/vararg-non-pod.cpp] (error) Internal error: Child process crashed with signal 11 [cppcheckError]
This commit is contained in:
Daniel Marjamäki 2018-04-25 18:48:26 +02:00
parent faf348306b
commit d8634ca2a9
1 changed files with 2 additions and 4 deletions

View File

@ -1320,7 +1320,8 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const
// function returning function pointer? '... ( ... %name% ( ... ))( ... ) {'
// function returning reference to array '... ( & %name% ( ... ))[ ... ] {'
if (tok->str() == "(" && tok->strAt(1) != "*" &&
// TODO: Activate this again
if (false && tok->str() == "(" && tok->strAt(1) != "*" &&
(tok->link()->previous()->str() == ")" || Token::simpleMatch(tok->link()->tokAt(-2), ") const"))) {
const Token* tok2 = tok->link()->next();
if (tok2 && tok2->str() == "(" && Token::Match(tok2->link()->next(), "{|;|const|=")) {
@ -1673,9 +1674,6 @@ Function::Function(const Tokenizer *_tokenizer, const Token *tok, const Scope *s
throwArg(nullptr),
flags(0)
{
if (Token::simpleMatch(tok, "( ^"))
throw InternalError(tok, "SymbolDatabase bailout: Unhandled code: ( ^ ...");
// operator function
if (tokenDef->isOperatorKeyword()) {
isOperator(true);