]> granicus.if.org Git - clang/commitdiff
Don't set Sema's StdNamespace or StdBadAlloc if they've already been set
authorDouglas Gregor <dgregor@apple.com>
Thu, 28 Jul 2011 00:57:24 +0000 (00:57 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 28 Jul 2011 00:57:24 +0000 (00:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136318 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReader.cpp

index 8b2d1a270e7e2b544bf0249f7f52ccfb4533e0b3..3eb887367c380c97dedecee0691dc886cf9e3af7 100644 (file)
@@ -4346,8 +4346,10 @@ void ASTReader::InitializeSema(Sema &S) {
   // They will be lazily deserialized when needed.
   if (!SemaDeclRefs.empty()) {
     assert(SemaDeclRefs.size() == 2 && "More decl refs than expected!");
-    SemaObj->StdNamespace = SemaDeclRefs[0];
-    SemaObj->StdBadAlloc = SemaDeclRefs[1];
+    if (!SemaObj->StdNamespace)
+      SemaObj->StdNamespace = SemaDeclRefs[0];
+    if (!SemaObj->StdBadAlloc)
+      SemaObj->StdBadAlloc = SemaDeclRefs[1];
   }
 
   for (Module *F = &ModuleMgr.getPrimaryModule(); F; F = F->NextInSource) {