Assert when trying to adjust _start in "needs delete" mode.
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index a7b5aef..4efc768 100755
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -150,6 +150,8 @@
 

 void StrPair::CollapseWhitespace()

 {

+    // Adjusting _start would cause undefined behavior on delete[]

+    TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 );

     // Trim leading space.

     _start = XMLUtil::SkipWhiteSpace( _start );