diff options
Diffstat (limited to 'lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 38b612cbd9..8dd53ee7d2 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "ASTCommon.h" +#include "ASTReaderInternals.h" #include "clang/Serialization/ASTReader.h" #include "clang/Sema/IdentifierResolver.h" #include "clang/Sema/Sema.h" @@ -2104,7 +2105,9 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) { DeclContextVisibleUpdates &U = I->second; for (DeclContextVisibleUpdates::iterator UI = U.begin(), UE = U.end(); UI != UE; ++UI) { - UI->second->DeclContextInfos[DC].NameLookupTableData = UI->first; + DeclContextInfo &Info = UI->second->DeclContextInfos[DC]; + delete Info.NameLookupTableData; + Info.NameLookupTableData = UI->first; } PendingVisibleUpdates.erase(I); } |