On windows when raw_fd_ostream::write_impl calls write, a 32 bit input is required for character count. As a variable with size_t is used for this argument on x64 integral demotion occurs. In the case of large files an infinite loop follows.
See: https://bugs.llvm.org/show_bug.cgi?id=37926
This fix allows the output of files larger than previous int32 limit.
Doesn't it actually require 32-bit unsigned input?
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/write