Tokenizer(simplifyNestedStrcat): correctly set line numbers for new tokens.
Pointed out by aggro80@ in IRC. Thanks!
This commit is contained in:
parent
24cd2bdbb4
commit
587e96322d
|
@ -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() == "(")
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue