Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return
errc::no_such_file_or_directory
in fs::access
if `GetFileA…
…ttributesW` fails (llvm#83495) Fixes llvm#83046 There is a race condition when calling `GetFileAttributesW` that can cause it to return `ERROR_ACCESS_DENIED` on a path which exists, which is unexpected for callers using this function to check for file existence by passing `AccessMode::Exist`. This was manifesting as a compiler crash on Windows downstream in the Swift compiler when using the `-index-store-path` flag (more information in swiftlang#8224). I looked for alternate APIs to avoid bringing in `shlwapi.h`, but didn't see any good candidates. I'm not tied at all to this solution, any feedback and alternative approaches are more than welcome.
- Loading branch information