Skip to content
Snippets Groups Projects
Commit fb4ad59d authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixes: Possible crash when parsing qt methods.

parent 25de88fe
No related branches found
No related tags found
No related merge requests found
...@@ -319,8 +319,8 @@ bool CheckExpression::visit(QtMethodAST *ast) ...@@ -319,8 +319,8 @@ bool CheckExpression::visit(QtMethodAST *ast)
Scope dummy; Scope dummy;
FullySpecifiedType methTy = semantic()->check(ast->declarator, FullySpecifiedType(), FullySpecifiedType methTy = semantic()->check(ast->declarator, FullySpecifiedType(),
&dummy, &name); &dummy, &name);
Function *fty = methTy->asFunctionType(); Function *fty = 0;
if (! fty) if (! methTy || 0 == (fty = methTy->asFunctionType()))
translationUnit()->warning(ast->firstToken(), "expected a function declarator"); translationUnit()->warning(ast->firstToken(), "expected a function declarator");
else { else {
for (unsigned i = 0; i < fty->argumentCount(); ++i) { for (unsigned i = 0; i < fty->argumentCount(); ++i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment