diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 7ca0300eed1e..24e4e2b02fb3 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -270,7 +270,7 @@ public: // Read all of the declarations visible at global scope with this // name. Sema *SemaObj = Reader.getSema(); - if (!SemaObj) return II; + if (Reader.getContext() == 0) return II; while (DataLen > 0) { NamedDecl *D = cast(Reader.GetDecl(ReadUnalignedLE32(d)));