summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2012-08-15 22:41:04 +0000
committerDeLesley Hutchins <delesley@google.com>2012-08-15 22:41:04 +0000
commit19c722d61df804a31aa093cff3ebf89ce9c9c0da (patch)
tree0886fbea92fe8367fe422bb2671593c9b24f95ed /clang/lib/Parse/ParseDecl.cpp
parent18023e4b20935b4194598a7eba5bef2653c9897c (diff)
downloadbcm5719-llvm-19c722d61df804a31aa093cff3ebf89ce9c9c0da.tar.gz
bcm5719-llvm-19c722d61df804a31aa093cff3ebf89ce9c9c0da.zip
Thread safety analysis: prevent a compiler error in cases where a
late-parsed attribute is attached to an invalid declaration. llvm-svn: 161997
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index b830d9ccfd9..a50f42bf8ba 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -866,7 +866,8 @@ void Parser::ParseLexedAttributes(ParsingClass &Class) {
void Parser::ParseLexedAttributeList(LateParsedAttrList &LAs, Decl *D,
bool EnterScope, bool OnDefinition) {
for (unsigned i = 0, ni = LAs.size(); i < ni; ++i) {
- LAs[i]->addDecl(D);
+ if (D)
+ LAs[i]->addDecl(D);
ParseLexedAttribute(*LAs[i], EnterScope, OnDefinition);
delete LAs[i];
}
OpenPOWER on IntegriCloud