We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 72fc9c0 + 0ca426e commit 48a1f0fCopy full SHA for 48a1f0f
llvm/lib/Support/Windows/Path.inc
@@ -630,6 +630,10 @@ std::error_code access(const Twine &Path, AccessMode Mode) {
630
DWORD Attributes = ::GetFileAttributesW(PathUtf16.begin());
631
632
if (Attributes == INVALID_FILE_ATTRIBUTES) {
633
+ // Avoid returning unexpected error codes when querying for existence.
634
+ if (Mode == AccessMode::Exist)
635
+ return errc::no_such_file_or_directory;
636
+
637
// See if the file didn't actually exist.
638
DWORD LastError = ::GetLastError();
639
if (LastError != ERROR_FILE_NOT_FOUND && LastError != ERROR_PATH_NOT_FOUND)
0 commit comments