[PATCH] D74488: [VFS] Fix vfsoverlay assertion due to RedirectingFileSystem path handling.

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 08:33:39 PST 2020


john.brawn created this revision.
john.brawn added reviewers: amccarth, rnk, vsapsai, arphaman.
Herald added subscribers: dexonsmith, hiraditya.
Herald added a project: LLVM.

The ClangScanDeps/vfsoverlay test can fail on Windows due to it ending up looking up paths that look like c:/foo\..\bar which hits an inconsistency in path handling: RedirectingFileSystemParser sees the c: and decides this is a windows path, canonicalize sees the first / and decides this is a posix path, and path::begin uses the native path style. The end result of this is we end up seeing '..' as a traversal component and hit an assertion failure.

Fix this by making lookupPath check the absolute path style, the same as RedirectingFileSystemParser does, and pass this through to path::begin.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74488

Files:
  llvm/lib/Support/VirtualFileSystem.cpp
  llvm/unittests/Support/VirtualFileSystemTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74488.244193.patch
Type: text/x-patch
Size: 4597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200212/9d82e346/attachment.bin>


More information about the llvm-commits mailing list