Skip to content

Commit

Permalink
Don't set Sema's StdNamespace or StdBadAlloc if they've already been set
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136318 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
DougGregor committed Jul 28, 2011
1 parent a126f17 commit 1e5b6f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Serialization/ASTReader.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit 1e5b6f6

Please sign in to comment.