================
@@ -1631,13 +1631,19 @@ bool SymbolFileDWARF::CompleteType(CompilerType 
&compiler_type) {
     return true;
   }
 
-  DWARFDIE dwarf_die = GetDIE(die_it->getSecond());
+  DWARFDIE dwarf_die = FindDefinitionDIE(GetDIE(die_it->getSecond()));
   if (dwarf_die) {
     // Once we start resolving this type, remove it from the forward
     // declaration map in case anyone child members or other types require this
     // type to get resolved. The type will get resolved when all of the calls
     // to SymbolFileDWARF::ResolveClangOpaqueTypeDefinition are done.
-    GetForwardDeclCompilerTypeToDIE().erase(die_it);
+    // Need to get a new iterator because FindDefinitionDIE might add new
----------------
ZequanWu wrote:

Now, we change `m_forward_decl_compiler_type_to_die` to be updated with 
definition DIE. So, we may need to erase twice, because the first erase is 
always necessary if we failed to find definition DIE for it. The second erase 
is because calling FindDefinitionDIE might add new entry to the definition DIE 
because the first one removed it.

https://github.com/llvm/llvm-project/pull/90663
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to