<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 24, 2013 at 8:10 AM, Olivier J. G. <span dir="ltr"><<a href="mailto:olivier.jg@gmail.com" target="_blank">olivier.jg@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Ping?<br></div></blockquote><div><br></div>
<div>The code review policy listed at <a href="http://llvm.org/docs/DeveloperPolicy.html#code-reviews">http://llvm.org/docs/DeveloperPolicy.html#code-reviews</a> suggests waiting a week before pinging.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"></div><div class=""><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 23, 2013 at 6:09 PM, Olivier J. G. <span dir="ltr"><<a href="mailto:olivier.jg@gmail.com" target="_blank">olivier.jg@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi,<br><br></div>While using clang_indexSourceFile(), I found that it crashes faithfully when you give it unsaved files. Upon further inspection I found this is apparently caused by a double-deletion:<br>


<br>clang_indexSourceFile_Impl creates llvm::MemoryBuffers with the unsaved file contents and uses MemBufferOwner to manage them.<br></div></div>However, it also creates an ASTUnit, which by default takes ownership of the unsaved file buffers. This leads to double deletion of the unsaved file buffers.<br>


<br></div><div>While it's possible to use ASTUnit::setOwnsRemappedFileBuffers(false) here, that would mean that the unsaved file contents are no longer available to the out_TU, which is presumably incorrect.<br><br></div>


<div>I've attached a (potential) fix.<br><br></div><div>Cheers,<br><br></div><div>-Olivier JG<br></div></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div>