Fix a crash in eraseToken
This commit is contained in:
parent
949e1ad6b8
commit
4f8ab7fa03
|
@ -377,6 +377,7 @@ void TOKEN::eraseToken()
|
||||||
{
|
{
|
||||||
TOKEN *next = this->next();
|
TOKEN *next = this->next();
|
||||||
this->next( next->next() );
|
this->next( next->next() );
|
||||||
|
if ( next->next() )
|
||||||
next->next()->previous( this );
|
next->next()->previous( this );
|
||||||
delete next;
|
delete next;
|
||||||
}
|
}
|
||||||
|
@ -404,7 +405,7 @@ void TOKEN::linenr( unsigned int linenr )
|
||||||
void TOKEN::printOut( const char *title ) const
|
void TOKEN::printOut( const char *title ) const
|
||||||
{
|
{
|
||||||
std::cout << std::endl << "###";
|
std::cout << std::endl << "###";
|
||||||
if( title )
|
if ( title )
|
||||||
std::cout << " " << title << " ";
|
std::cout << " " << title << " ";
|
||||||
else
|
else
|
||||||
std::cout << "########";
|
std::cout << "########";
|
||||||
|
@ -413,7 +414,7 @@ void TOKEN::printOut( const char *title ) const
|
||||||
for( const TOKEN *t = this; t; t = t->next() )
|
for( const TOKEN *t = this; t; t = t->next() )
|
||||||
{
|
{
|
||||||
std::cout << t->linenr() << ": " << t->str();
|
std::cout << t->linenr() << ": " << t->str();
|
||||||
if( t->varId() )
|
if ( t->varId() )
|
||||||
std::cout << " ("<< t->varId() <<")";
|
std::cout << " ("<< t->varId() <<")";
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
Loading…
Reference in New Issue