branches/KDE/3.5/kdevelop/lib/cppparser

Andreas Pakulat apaku at gmx.de
Sat Aug 30 22:52:38 UTC 2008


SVN commit 855009 by apaku:

increase the vector by 5001 instead of 5000, for some reason one could hit an
out-of-bounds error when using 5000 instead of 5001 in a specific position of a
file.

This might just be a workaround, but I couldn't reproduce the original error
when placing the cursor one token further than the place it originally
triggered in. Thus I'm at least somewhat sure the bug is actually fixed and not
just workarounded for this particular example

David, Kris, anybody who ever looked at cppparser please check out
https://bugs.kde.org/show_bug.cgi?id=170044
and this patch and let me know if I did something stupid :)

BUG: 170044
CCMAIL: kdevelop-devel at kdevelop.org



 M  +1 -1      lexer.cpp  


--- branches/KDE/3.5/kdevelop/lib/cppparser/lexer.cpp #855008:855009
@@ -212,7 +212,7 @@
     int op = 0;
 
     if( m_size == (int)m_tokens.size() ){
-	m_tokens.resize( m_tokens.size() + 5000 );
+	m_tokens.resize( m_tokens.size() + 5000 + 1 );
     }
 
     readWhiteSpaces( !stopOnNewline );




More information about the KDevelop-devel mailing list