[PATCH] D86564: [Support][Windows] Fix incorrect GetFinalPathNameByHandleW() return value check in realPathFromHandle()

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 06:20:02 PDT 2020


andrewng 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()) {
----------------
I did consider this change too, but then I decided not to assume that the call to `GetFinalPathNameByHandleW` below is going to succeed.


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