Author: Zequan Wu
Date: 2022-09-01T13:10:57-07:00
New Revision: afeb2d0a21e383b5436b539f311ea00803d24e24

URL: 
https://github.com/llvm/llvm-project/commit/afeb2d0a21e383b5436b539f311ea00803d24e24
DIFF: 
https://github.com/llvm/llvm-project/commit/afeb2d0a21e383b5436b539f311ea00803d24e24.diff

LOG: [LLDB][NativePDB] Fix a minor bug.

llvm::codeview::visitMemberRecordStream in CompleteTagDecl will call
GetOrCreateType create type if not seen before, which inserts new entries
into m_decl_to_status. This may invalidates status which is a reference to
std::pair::second from DenseMapIterator.

Added: 
    

Modified: 
    lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp 
b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
index b8848839f24f7..21b1cb2384994 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
@@ -776,7 +776,7 @@ bool PdbAstBuilder::CompleteTagDecl(clang::TagDecl &tag) {
       llvm::codeview::visitMemberRecordStream(field_list.Data, completer);
   completer.complete();
 
-  status.resolved = true;
+  m_decl_to_status[&tag].resolved = true;
   if (error) {
     llvm::consumeError(std::move(error));
     return false;


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to