<html><body><div><div>Attached is a patch that fixes this problem. It was made against trunk rev. 136769. Should I close bug#10511 myself when the patch is accepted, or how does that work?</div><div><br></div><div>-- Erik.<br></div><br>On 26 Jul, 2011,at 04:57 PM, Douglas Gregor <dgregor@apple.com> wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch"><br>
On Jul 26, 2011, at 7:32 AM, Erik Verbruggen wrote:<br>
<br>
> Hello,<br>
> <br>
> I'm using libclang, and when using clang_reparseTranslationUnit method, I (nearly?) always get a crash:<br>
> <br>
> Assertion failed: ((LatestDecl->getLocation().isInvalid() || NewLatest->getLocation().isInvalid() || !Reader.SourceMgr.isBeforeInTranslationUnit( NewLatest->getLocation(), LatestDecl->getLocation())) && "The new latest is supposed to come after the previous latest"), function VisitRedeclarableTemplateDecl, file /data/clang-llvm/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp, line 1094.<br>
> libclang: crash detected during reparsing<br>
> <br>
> When I turn off CXTranslationUnit_CXXPrecompiledPreamble, things work fine (although quite a bit slower).<br>
> <br>
> Does anybody have an idea how I can debug this, or in which direction I should look?<br>
<br>
That sounds like a serious bug in the AST reader or writer. Debugging these can be fairly tricky; in this case, watching how that particular declaration ends up getting deserialized. If you could file a bug with reduced source code detailing the problem (which can be tricky, when dealing with preambles), we'd greatly appreciate it.<br>
<br>
        - Doug<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" _mce_href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" _mce_href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div></body></html>