Fixed bug in Token::swapWithNext(): swap _link correctly

This commit is contained in:
PKEuS 2016-02-02 17:47:22 +01:00
parent 7b68da3017
commit e063e97831
1 changed files with 4 additions and 0 deletions

View File

@ -197,6 +197,10 @@ void Token::swapWithNext()
std::swap(_varId, _next->_varId);
std::swap(_fileIndex, _next->_fileIndex);
std::swap(_linenr, _next->_linenr);
if (_next->_link)
_next->_link->_link = this;
if (this->_link)
this->_link->_link = _next;
std::swap(_link, _next->_link);
std::swap(_scope, _next->_scope);
std::swap(_function, _next->_function);