aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-16 02:35:10 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-16 02:35:10 +0000
commit35593a9add85353532519f8eba5ec513a611aac5 (patch)
tree4d731f265d71eecdf40d3673da1c6d7eb2b3a890 /lib/Frontend/ASTUnit.cpp
parent3e340a67f4522a2f633a719cb7f3389fe2474374 (diff)
[libclang] Fix crash on invalid code. Fixes rdar://10451854
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 0b9c37a223..64b931f5a8 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -853,6 +853,9 @@ public:
}
void handleTopLevelDecl(Decl *D) {
+ if (!D)
+ return;
+
// FIXME: Currently ObjC method declarations are incorrectly being
// reported as top-level declarations, even though their DeclContext
// is the containing ObjC @interface/@implementation. This is a