[PATCH] D86564: [Support][Windows] Fix incorrect GetFinalPathNameByHandleW() return value check in realPathFromHandle()
Aleksandr Platonov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 06:40:25 PDT 2020
ArcsinX added inline comments.
================
Comment at: llvm/lib/Support/Windows/Path.inc:356-357
+ H, Buffer.begin(), Buffer.capacity(), FILE_NAME_NORMALIZED);
+ if (CountChars == 0)
+ return mapWindowsError(GetLastError());
+ if (CountChars >= Buffer.capacity()) {
----------------
andrewng wrote:
> I did consider this change too, but then I decided not to assume that the call to `GetFinalPathNameByHandleW` below is going to succeed.
Yes, you are right.
Every of `GetFinalPathNameByHandleW()` calls could return 0 in case of failure, so we need to check `CountChars` for 0 for both calls.
So, I have reverted that change.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86564/new/
https://reviews.llvm.org/D86564
More information about the llvm-commits
mailing list