Skip to content

Commit

Permalink
[LLDB][NativePDB] Fix a minor bug.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ZequanWu committed Sep 1, 2022
1 parent 9110673 commit afeb2d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit afeb2d0

Please sign in to comment.