When performing name lookup into a scope, check that its entity is
non-NULL before looking at the entity itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93199 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index a8c2366..bff7881 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -648,7 +648,7 @@
for (; S; S = S->getParent()) {
DeclContext *Ctx = static_cast<DeclContext *>(S->getEntity());
- if (Ctx->isTransparentContext())
+ if (!Ctx || Ctx->isTransparentContext())
continue;
assert(Ctx && Ctx->isFileContext() &&