[cfe-dev] RewriteRope.cpp assertion: Assertion `getPiece(StartPiece).size() > NumBytes' failed.

Mehdi AMINI mehdi.amini at silkan.com
Fri Apr 26 19:59:27 PDT 2013


On 4/26/13 10:39 AM, Peeter Joot wrote:
> Get
> /home/hotellnx94/peeterj/clang/sources/llvm/tools/clang/lib/Rewrite/Core/RewriteRope.cpp:377:
> void {anonymous}::RopePieceBTreeLeaf::erase(unsigned int, unsigned int):
> Assertion `getPiece(StartPiece).size() > NumBytes' failed.
> Abort
> Are there any known issues here (or a possible bug in my replacement code) :

The issue is maybe the way you are using the Replacements class. Are you 
rewriting multiple time the same location? Do you have any overlap in 
your replacements? Do you call applyAllReplacements() multiple time with 
different replacements?

All these practices are likely to fail. I feel that if the Replacement 
were based on SourceRange and SourceLocation instead of 
File/Offset/Length it would help handling these "complex" situations.


More information about the cfe-dev mailing list