Browse Source

pipeline: Avoid Twine

For some reason, Twine(int), when concatenated, may incorrectly become Twine(const unsigned long&) and cause a dereference crash.
pull/813/head
Fangrui Song 3 years ago
parent
commit
f21fd7e5a2
  1. 2
      src/pipeline.cc

2
src/pipeline.cc

@ -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)

Loading…
Cancel
Save