[clang] Make PCH's respect any VFS specified. (PR #106577)

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 13:15:01 PDT 2024


================
@@ -1115,13 +1115,13 @@ void ASTWriter::WriteBlockInfoBlock() {
 }
 
 /// Prepares a path for being written to an AST file by converting it
-/// to an absolute path and removing nested './'s.
+/// to an absolute path and removing nested './'s and '../'s.
 ///
 /// \return \c true if the path was changed.
 static bool cleanPathForOutput(FileManager &FileMgr,
                                SmallVectorImpl<char> &Path) {
   bool Changed = FileMgr.makeAbsolutePath(Path);
-  return Changed | llvm::sys::path::remove_dots(Path);
+  return Changed | llvm::sys::path::remove_dots(Path, true);
----------------
benlangmuir wrote:

The redirecting filesystem itself removes .. (which is maybe not 100% correct either but it's more limited there than it would be here I think). Can you clarify why that's not sufficient? I think I must be missing why this is needed.

https://github.com/llvm/llvm-project/pull/106577


More information about the cfe-commits mailing list