From f21fd7e5a2181e342bf2de6cee2854c38b0b21e8 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 26 Jun 2021 12:07:41 -0700 Subject: [PATCH] pipeline: Avoid Twine For some reason, Twine(int), when concatenated, may incorrectly become Twine(const unsigned long&) and cause a dereference crash. --- src/pipeline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipeline.cc b/src/pipeline.cc index 0bd65fc8..45a29742 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -377,7 +377,7 @@ bool indexer_Parse(SemaManager *completion, WorkingFiles *wfiles, SmallString<256> msg; (Twine(deleted ? "delete " : "parse ") + path_to_index).toVector(msg); 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)) { msg += "\n "; for (const char *arg : entry.args)