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:
parent
faf348306b
commit
d8634ca2a9
|
@ -1320,7 +1320,8 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const
|
||||||
|
|
||||||
// function returning function pointer? '... ( ... %name% ( ... ))( ... ) {'
|
// function returning function pointer? '... ( ... %name% ( ... ))( ... ) {'
|
||||||
// function returning reference to array '... ( & %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"))) {
|
(tok->link()->previous()->str() == ")" || Token::simpleMatch(tok->link()->tokAt(-2), ") const"))) {
|
||||||
const Token* tok2 = tok->link()->next();
|
const Token* tok2 = tok->link()->next();
|
||||||
if (tok2 && tok2->str() == "(" && Token::Match(tok2->link()->next(), "{|;|const|=")) {
|
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),
|
throwArg(nullptr),
|
||||||
flags(0)
|
flags(0)
|
||||||
{
|
{
|
||||||
if (Token::simpleMatch(tok, "( ^"))
|
|
||||||
throw InternalError(tok, "SymbolDatabase bailout: Unhandled code: ( ^ ...");
|
|
||||||
|
|
||||||
// operator function
|
// operator function
|
||||||
if (tokenDef->isOperatorKeyword()) {
|
if (tokenDef->isOperatorKeyword()) {
|
||||||
isOperator(true);
|
isOperator(true);
|
||||||
|
|
Loading…
Reference in New Issue