for (InputFile *F : Files) Symtab->addFile<ELFT>(F); // if there is a duplicate symbol error ... Target = getTarget();
When parsing .debug_info in the object file (for better diagnostics),
DWARF.cpp findAux may dereference the null pointer Target
auto *DR = dyn_cast<Defined>(&File->getRelocTargetSym(Rel)); if (!DR) { /// Some asan object files contain R_X86_64_NONE RelType Type = Rel.getType(Config->IsMips64EL); if (Type != Target->NoneRel) /// Target is null
Move the assignment of Target to an earlier place to fix this.
nit: I would not refer to the DWARF.cpp:findAux in the test cases comment.
Simply because both the file name and function name might change.