Fixed use-after-free found by asan

This commit is contained in:
Daniel Marjamäki 2018-01-05 17:06:02 +01:00
parent 04c57381ea
commit 2c5225af43
1 changed files with 2 additions and 0 deletions

View File

@ -811,6 +811,8 @@ void TemplateSimplifier::simplifyTemplateAliases(std::list<TemplateSimplifier::T
const Token * const fromEnd = args[argnr].second->previous();
Token * const destToken = tok2;
tok2 = Tokenizer::copyTokens(tok2, fromStart, fromEnd, true);
if (tok2 == destToken->next())
tok2 = destToken;
destToken->deleteThis();
}