llvm-project
e46c62ce - [lld-link] Fix use-after-free in --time-trace with type server PDBs (#242726)

Commit
5 days ago
[lld-link] Fix use-after-free in --time-trace with type server PDBs (#242726) LinkerDriver::enqueuePath() used to capture its `StringRef path` parameter. For type server PDBs, `path` is a local in ObjFile::enqueuePdbFile() and the StringRef dangles and points to garbage (which in assert-enabled builds usually isn't valid UTF-8, making the trace assert with "Invalid UTF-8 in value used as JSON"). Instead, use the already-existing std::string copy of the path.
Author
Parents
Loading