[PATCH] D48948: Fix raw_fd_ostream::write_impl hang due to an infinite loop with large output

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 10:37:46 PDT 2018


zturner added inline comments.


================
Comment at: lib/Support/raw_ostream.cpp:617-618
+#ifdef _WIN64
+  // Windows write() requires signed 32 bit input so SIZE_MAX can not be used 
+  size_t MaxWriteSize = _I32_MAX;
+#else
----------------
Doesn't it actually require 32-bit unsigned input?

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/write

```
int _write(
   int fd,
   const void *buffer,
   unsigned int count
);
```


Repository:
  rL LLVM

https://reviews.llvm.org/D48948





More information about the llvm-commits mailing list