Tokenizer: Set proper variable ID when simplifying return statement. Ticket: #3500

This commit is contained in:
Daniel Marjamki 2013-01-19 13:42:54 +01:00
parent bff6ed7af0
commit 6d5532980e
1 changed files with 2 additions and 0 deletions

View File

@ -6253,6 +6253,7 @@ bool Tokenizer::simplifyKnownVariablesSimplify(Token **tok2, Token *tok3, unsign
if (!Token::Match(tok3->previous(), "( %var% )") &&
Token::Match(tok3->previous(), "&&|(|%oror% %varid% &&|%oror%|)", varid)) {
tok3->str(value);
tok3->varId(valueVarId);
ret = true;
}
@ -6261,6 +6262,7 @@ bool Tokenizer::simplifyKnownVariablesSimplify(Token **tok2, Token *tok3, unsign
// If the parameter is passed by value then simplify it
if (isFunctionParameterPassedByValue(tok3)) {
tok3->str(value);
tok3->varId(valueVarId);
ret = true;
}
}