From 6d5532980ec10ebccb47e2b16194c0d76364f543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=E4ki?= Date: Sat, 19 Jan 2013 13:42:54 +0100 Subject: [PATCH] Tokenizer: Set proper variable ID when simplifying return statement. Ticket: #3500 --- lib/tokenize.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 314ec2d61..768f381a4 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -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; } }