[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 03:07:54 PDT 2020


ArcsinX added inline comments.


================
Comment at: llvm/lib/Support/Windows/Path.inc:356
+      H, Buffer.begin(), Buffer.capacity(), FILE_NAME_NORMALIZED);
+  if (CountChars > Buffer.capacity() - 1) {
     // The buffer wasn't big enough, try again.  In this case the return value
----------------
andrewng wrote:
> If `Buffer.capacity() == 0` this check will fail. This case would have also caused issues with the previous code.
Thanks. Fixed.


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