Merge pull request #681 from Dmitry-Me/betterVariableName5
Better variable name, explicit no-op
This commit is contained in:
commit
1f9fa89dc9
|
@ -1198,7 +1198,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
|
||||||
else {
|
else {
|
||||||
bool use = false;
|
bool use = false;
|
||||||
|
|
||||||
std::stack<const Token *> f;
|
std::stack<const Token *> functions;
|
||||||
|
|
||||||
for (const Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
|
for (const Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
|
||||||
if (tok2->str() == ";") {
|
if (tok2->str() == ";") {
|
||||||
|
@ -1207,17 +1207,18 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tok2->str() == "(")
|
if (tok2->str() == "(")
|
||||||
f.push(tok2->previous());
|
functions.push(tok2->previous());
|
||||||
else if (!f.empty() && tok2->str() == ")")
|
else if (!functions.empty() && tok2->str() == ")")
|
||||||
f.pop();
|
functions.pop();
|
||||||
|
|
||||||
if (tok2->varId() == varid) {
|
if (tok2->varId() == varid) {
|
||||||
// Read data..
|
// Read data..
|
||||||
if (!Token::Match(tok2->previous(), "&|(") &&
|
if (!Token::Match(tok2->previous(), "&|(") &&
|
||||||
tok2->strAt(1) == "[") {
|
tok2->strAt(1) == "[") {
|
||||||
} else if (f.empty() ||
|
;
|
||||||
!test_white_list(f.top()->str(), _settings, tokenizer->isCPP()) ||
|
} else if (functions.empty() ||
|
||||||
getDeallocationType(f.top(),varid)) {
|
!test_white_list(functions.top()->str(), _settings, tokenizer->isCPP()) ||
|
||||||
|
getDeallocationType(functions.top(),varid)) {
|
||||||
use = true;
|
use = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue