aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteRope.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Rewrite/RewriteRope.cpp')
-rw-r--r--lib/Rewrite/RewriteRope.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Rewrite/RewriteRope.cpp b/lib/Rewrite/RewriteRope.cpp
index db55aa1cd4..7ee9fcced2 100644
--- a/lib/Rewrite/RewriteRope.cpp
+++ b/lib/Rewrite/RewriteRope.cpp
@@ -741,6 +741,7 @@ void RopePieceBTree::erase(unsigned Offset, unsigned NumBytes) {
/// allocation instead of doing tons of tiny allocations.
RopePiece RewriteRope::MakeRopeString(const char *Start, const char *End) {
unsigned Len = End-Start;
+ assert(Len && "Zero length RopePiece is invalid!");
// If we have space for this string in the current alloc buffer, use it.
if (AllocOffs+Len <= AllocChunkSize) {