diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-08-05 09:45:12 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-08-05 09:59:11 +0200 |
commit | 393806696d0625c7998b29aa4a841860fb6bdac1 (patch) | |
tree | 11b6b46f2b6632192bf9b0e07b443c569a86c627 /src/shared/cplusplus/Parser.cpp | |
parent | 80e26d86c98c8710b8e8ad709acb0bc047535681 (diff) | |
download | qt-creator-393806696d0625c7998b29aa4a841860fb6bdac1.tar.gz |
The parser needs to a valid AST when the parsing method returns `true'.
Diffstat (limited to 'src/shared/cplusplus/Parser.cpp')
-rw-r--r-- | src/shared/cplusplus/Parser.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index c4eb17ab64..ee65f2c009 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -4053,7 +4053,7 @@ bool Parser::parseObjCInterface(DeclarationAST *&node, match(T_RPAREN, &(ast->rparen_token)); parseObjCProtocolRefs(ast->protocol_refs); - + DeclarationListAST **nextMembers = &(ast->member_declarations); DeclarationAST *declaration = 0; while (parseObjCInterfaceMemberDeclaration(declaration)) { @@ -4317,7 +4317,7 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node) bool Parser::parseObjCMethodDefinition(DeclarationAST *&node) { - ObjCMethodPrototypeAST *method_prototype; + ObjCMethodPrototypeAST *method_prototype = 0; if (! parseObjCMethodPrototype(method_prototype)) return false; @@ -4565,14 +4565,10 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node) DeclarationAST *parameter_declaration = 0; parseParameterDeclaration(parameter_declaration); } - - node = ast; } else if (lookAtObjCSelector()) { ObjCSelectorWithoutArgumentsAST *sel = new (_pool) ObjCSelectorWithoutArgumentsAST; parseObjCSelector(sel->name_token); ast->selector = sel; - - node = ast; } else { _translationUnit->error(cursor(), "expected a selector"); } @@ -4581,6 +4577,7 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node) while (parseAttributeSpecifier(*attr)) attr = &(*attr)->next; + node = ast; return true; } |