Fixed use-after-free found by asan
This commit is contained in:
parent
04c57381ea
commit
2c5225af43
|
@ -811,6 +811,8 @@ void TemplateSimplifier::simplifyTemplateAliases(std::list<TemplateSimplifier::T
|
||||||
const Token * const fromEnd = args[argnr].second->previous();
|
const Token * const fromEnd = args[argnr].second->previous();
|
||||||
Token * const destToken = tok2;
|
Token * const destToken = tok2;
|
||||||
tok2 = Tokenizer::copyTokens(tok2, fromStart, fromEnd, true);
|
tok2 = Tokenizer::copyTokens(tok2, fromStart, fromEnd, true);
|
||||||
|
if (tok2 == destToken->next())
|
||||||
|
tok2 = destToken;
|
||||||
destToken->deleteThis();
|
destToken->deleteThis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue