llvm-project/llvm/lib/Support/Windows
Aleksandr Platonov ceffd6993c [Support][Windows] Fix incorrect GetFinalPathNameByHandleW() return value check in realPathFromHandle()
`GetFinalPathNameByHandleW(,,N,)` returns:
- `< N` on success (this value does not include the size of the terminating null character)
- `>= N` if buffer is too small (this value includes the size of the terminating null character)

So, when `N == Buffer.capacity() - 1`, we need to resize buffer if return value is > `Buffer.capacity() - 2`.
Also, we can set `N` to `Buffer.capacity()`.

Thus, without this patch `realPathFromHandle()` returns unfilled buffer when length of the final path of the file is equal to `Buffer.capacity()` or `Buffer.capacity() - 1`.

Reviewed By: andrewng, amccarth

Differential Revision: https://reviews.llvm.org/D86564
2020-08-26 22:11:44 +03:00
..
COM.inc
DynamicLibrary.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Host.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Memory.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Path.inc [Support][Windows] Fix incorrect GetFinalPathNameByHandleW() return value check in realPathFromHandle() 2020-08-26 22:11:44 +03:00
Process.inc Introduce llvm::sys::Process::getProcessId() and adopt it 2020-04-16 15:05:37 +03:00
Program.inc [Windows] Fix limit on command line size 2020-07-23 11:39:42 +07:00
Signals.inc [Support] Allow printing the stack trace only for a given depth 2020-08-26 09:27:42 -04:00
ThreadLocal.inc llvm-ar: Fix MinGW compilation 2020-02-28 09:59:24 +01:00
Threading.inc [ThinLTO] Allow usage of all hardware threads in the system 2020-03-27 10:20:58 -04:00
Watchdog.inc
explicit_symbols.inc Remove support for unsupported MSVC versions 2019-08-02 23:09:01 +00:00