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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits