[patch][pr23266] Fix some raw_svector_ostream::pwrite problems

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Apr 17 07:51:13 PDT 2015


The fix-buffer patch is a simple bug fix for when pwrite changes the
size of the underlying stream.

The issue that remains is that pwrite changing the current position is
somewhat surprising.

That also happens on OS X when using O_APPEND. The attached test
creates a file with "defghi\n" in it, so there is some precedent. (on
linux one gets "abcdefghi").

In any case, if that is too confusing, we can also just disallow it,
which is what the other patch does. If disallowing it, should we
rename it?

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dont-change-size.patch
Type: application/octet-stream
Size: 5086 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150417/48450a86/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-buffer.patch
Type: application/octet-stream
Size: 1271 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150417/48450a86/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150417/48450a86/attachment.c>


More information about the llvm-commits mailing list