Tokenizer(simplifyNestedStrcat): correctly set line numbers for new tokens.

Pointed out by aggro80@ in IRC. Thanks!
This commit is contained in:
Slava Semushin 2009-09-06 17:33:55 +07:00
parent 24cd2bdbb4
commit 587e96322d
1 changed files with 5 additions and 0 deletions

View File

@ -3370,6 +3370,7 @@ void Tokenizer::simplifyNestedStrcat()
Token *end = tok2->next()->link()->next();
Token *endOfFirstArg = NULL;
std::stack<Token *> brackets;
unsigned int lineno = tok->next()->linenr();
// copy tokens to new place
for (Token *cur = tok2; cur != end; cur = cur->next())
@ -3388,6 +3389,10 @@ void Tokenizer::simplifyNestedStrcat()
insertPos->varId(cur->varId());
}
// use line number of first strcat token for all new
// tokens
insertPos->linenr(lineno);
// linkify braces
if (insertPos->str() == "(")
{