[llvm-dev] lld crash working with .lib import files

Carlo Kok via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 2 00:50:01 PDT 2017


It's crashing here:

// Returns a string in the format of "foo.obj" or "foo.obj(bar.lib)".
std::string lld::toString(coff::InputFile *File) {
  if (!File)
    return "(internal)";
  if (File->ParentName.empty())
    return File->getName().lower();


Called from:
void SymbolTable::addFile(InputFile *File) {
  log("Reading " + toString(File));

If I add:

  if (File->ImportKind == coff::InputFile::ImportKind)
	  return "(import)";
in the toString, it works fine 


Repro file here:

https://1drv.ms/u/s!Au2nm7P_hgmasw-8bTrj15qtZ2pr

My question is, is my fix right?




--
Carlo Kok
RemObjects Software


More information about the llvm-dev mailing list