pipeline: Avoid Twine

For some reason, Twine(int), when concatenated, may incorrectly become Twine(const unsigned long&) and cause a dereference crash.
This commit is contained in:
Fangrui Song 2021-06-26 12:07:41 -07:00
parent 80d06eb476
commit f21fd7e5a2

View File

@ -377,7 +377,7 @@ bool indexer_Parse(SemaManager *completion, WorkingFiles *wfiles,
SmallString<256> msg; SmallString<256> msg;
(Twine(deleted ? "delete " : "parse ") + path_to_index).toVector(msg); (Twine(deleted ? "delete " : "parse ") + path_to_index).toVector(msg);
if (n_errs) if (n_errs)
msg += (" error:" + Twine(n_errs) + " " + first_error).toStringRef(tmp); msg += " error:" + std::to_string(n_errs) + ' ' + first_error;
if (LOG_V_ENABLED(1)) { if (LOG_V_ENABLED(1)) {
msg += "\n "; msg += "\n ";
for (const char *arg : entry.args) for (const char *arg : entry.args)