]> granicus.if.org Git - clang/commitdiff
RewriteBuffer::write(): Add a doc comment about non-portable use
authorAlp Toker <alp@nuanti.com>
Sun, 17 Nov 2013 18:13:43 +0000 (18:13 +0000)
committerAlp Toker <alp@nuanti.com>
Sun, 17 Nov 2013 18:13:43 +0000 (18:13 +0000)
The function isn't strictly at fault but there are callers using it
incorrectly, causing crashes with in-place edits of 64KB or larger files on
Windows.

See PR17960 for details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194972 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Rewrite/Core/Rewriter.h

index f01e433f7fcce6cc0a066d59636d6518ba784fdf..2d2917b910b9414efa6f619393b678bb36377316 100644 (file)
@@ -49,6 +49,9 @@ public:
 
   /// \brief Write to \p Stream the result of applying all changes to the
   /// original buffer.
+  /// Note that it isn't safe to use this function to overwrite memory mapped
+  /// files in-place (PR17960). Consider using a higher-level utility such as
+  /// Rewriter::overwriteChangedFiles() instead.
   ///
   /// The original buffer is not actually changed.
   raw_ostream &write(raw_ostream &Stream) const;