[PATCH] D46602: [clang-tidy] Store checks profiling info as YAML files

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 2 05:31:36 PDT 2018


lebedev.ri added inline comments.


================
Comment at: clang-tidy/tool/ClangTidyMain.cpp:342-347
+    if (!llvm::sys::fs::exists(AbsolutePath)) {
+      // If the destination prefix does not exist, don't try to use real_path().
+      return AbsolutePath;
+    }
+    SmallString<256> dest;
+    if (std::error_code EC = llvm::sys::fs::real_path(AbsolutePath, dest)) {
----------------
aaron.ballman wrote:
> This creates a TOCTOU bug; can you call `real_path()` without checking for existence and instead check the error code to decide whether to spit out an error or return `AbsolutePath`?
Hmm, i think this can just go away.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D46602





More information about the llvm-commits mailing list