summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 7483f7854c6..7ca0300eed1 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -270,6 +270,8 @@ public:
// Read all of the declarations visible at global scope with this
// name.
Sema *SemaObj = Reader.getSema();
+ if (!SemaObj) return II;
+
while (DataLen > 0) {
NamedDecl *D = cast<NamedDecl>(Reader.GetDecl(ReadUnalignedLE32(d)));
if (SemaObj) {
OpenPOWER on IntegriCloud