aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAleksandr Platonov <platonov.aleksandr@huawei.com>2020-08-26 22:10:35 +0300
committerAleksandr Platonov <platonov.aleksandr@huawei.com>2020-08-26 22:11:44 +0300
commitceffd6993c350b57f43cec3b6371b159fc4a3149 (patch)
treef54b9e20434c81167e639d859bd958f51be282d3 /clang/lib/Frontend/CompilerInvocation.cpp
parent28fbf422f248fc74681a53208aa2f543a67515ac (diff)
downloadllvm-ceffd6993c350b57f43cec3b6371b159fc4a3149.zip
llvm-ceffd6993c350b57f43cec3b6371b159fc4a3149.tar.gz
llvm-ceffd6993c350b57f43cec3b6371b159fc4a3149.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions