aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-01-13 00:14:12 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-01-13 00:14:12 +0000
commit9baf39df74caa56696b293e763fdd7ef002e51ca (patch)
treecaf0b20b9822bbc5e11a0169bc6a9cf409ead9f7 /lib/Parse/ParseDecl.cpp
parent7984de35644701c0d94336da7f2215d4c26d9f5b (diff)
objc parsing. Fixes a crash when parsing array initialization
inside a class implementation with parse errors. // rdar://10633434 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 032326cea7..1c7c45e2bd 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1150,11 +1150,12 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
MaybeParseGNUAttributes(D);
ParseDeclarator(D);
-
- Decl *ThisDecl = ParseDeclarationAfterDeclarator(D);
- D.complete(ThisDecl);
- if (ThisDecl)
- DeclsInGroup.push_back(ThisDecl);
+ if (!D.isInvalidType()) {
+ Decl *ThisDecl = ParseDeclarationAfterDeclarator(D);
+ D.complete(ThisDecl);
+ if (ThisDecl)
+ DeclsInGroup.push_back(ThisDecl);
+ }
}
if (DeclEnd)