Bug #13867 2008-05-24 18:25

carjay

CurrentChar() in tokenizer.h does not check for EOF

When you try to debug codeblocks and use a debug version of wxWidgets asserts may shop up which indicate that CurrentChar() is trying to access memory right past m_Buffer.

If you look at tokenizer.cpp there are plenty of places where MoveToNextChar() is called without checking its return value (which is false in case the end of the buffer was reached).

Of course depending on the memory layout in wxString this may or may not lead to a crash (seems it usually causes no problems), at least it will return something invalid.

But it is really annoying when you use a debug version of wxWidgets because it triggers a fatal assert.

Category
Plugin::CodeCompletion
Group
 
Status
Closed
Close date
2010-10-15 13:24
Assigned to
loaden
carjay 2008-05-24 18:31

attached patch #002481 as a simple proposal to stop the asserts from happening.

It's not really a good fix since the parser should not try to access an invalid buffer position in the first place but it's better than nothing.

loaden 2010-10-15 13:24

This bug has been already fixed in HEAD.

Thank you.