llvm-project/clang/lib/Parse
Bruno Cardoso Lopes 218c8743c8 [SemaObjC] Be more strict while parsing type arguments and protocols
Fix a crash-on-invalid.

When parsing type arguments and protocols,
parseObjCTypeArgsOrProtocolQualifiers() calls ParseTypeName(), which tries to
find matching tokens for '[', '(', etc whenever they appear among potential
type names. If unmatched, ParseTypeName() yields a tok::eof token stream. This
leads to crashes since the parsing at this point is not expected to go beyond
the param list closing '>'.

Fix that by properly handling tok::eof in
parseObjCTypeArgsOrProtocolQualifiers() callers.

Differential Revision: https://reviews.llvm.org/D23852

rdar://problem/25063557

llvm-svn: 281383
2016-09-13 20:04:35 +00:00
..
CMakeLists.txt [CMake] Reorder libdeps by alphabetical order. 2014-07-14 04:59:27 +00:00
ParseAST.cpp C++ Modules TS: add frontend support for building pcm files from module 2016-08-26 00:14:38 +00:00
ParseCXXInlineMethods.cpp Fix a few issues while skipping function bodies 2016-06-16 21:40:06 +00:00
ParseDecl.cpp [SemaObjC] Be more strict while parsing type arguments and protocols 2016-09-13 20:04:35 +00:00
ParseDeclCXX.cpp C++ Modules TS: Add parsing and some semantic analysis support for 2016-09-08 23:14:54 +00:00
ParseExpr.cpp [Parser] Fix bug where delayed typo in conditional expression was corrected twice 2016-07-29 00:55:40 +00:00
ParseExprCXX.cpp Pass information in a record instead of stack. NFC 2016-08-08 04:02:15 +00:00
ParseInit.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
ParseObjc.cpp [SemaObjC] Be more strict while parsing type arguments and protocols 2016-09-13 20:04:35 +00:00
ParseOpenMP.cpp Move calls of MaybeParseMicrosoftAttributes() before ParseExternalDeclaration() 2016-09-03 02:48:03 +00:00
ParsePragma.cpp Parsing MS pragma intrinsic 2016-09-07 16:38:32 +00:00
ParseStmt.cpp [Parse] Let declarations follow labels in -fms-extensions mode 2016-08-01 16:39:29 +00:00
ParseStmtAsm.cpp Fix a funny Dvorak typo. 2016-05-19 00:16:09 +00:00
ParseTemplate.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
ParseTentative.cpp P0217R3: Parsing support and framework for AST representation of C++1z 2016-07-22 23:36:59 +00:00
Parser.cpp [SemaObjC] Be more strict while parsing type arguments and protocols 2016-09-13 20:04:35 +00:00
RAIIObjectsForParser.h Add a new error for unexpected semi-colon before closing delimiter. 2015-05-12 21:36:35 +00:00