Merge pull request #572 from Dmitry-Me/mergeOverlappingPatterns4

Merge overlapping patterns
This commit is contained in:
amai2012 2015-03-24 16:55:37 +01:00
commit 035faa4b6b
1 changed files with 1 additions and 2 deletions

View File

@ -1248,8 +1248,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
Token::Match(tok, "= strcpy|strcat|memmove|memcpy ( %varid% ,", varid) ||
Token::Match(tok, "[;{}] %name% [ %varid% ]", varid)) {
addtoken(&rettail, tok, "use");
} else if (Token::Match(tok->previous(), ";|{|}|=|(|,|%cop% %varid% [", varid) ||
Token::Match(tok->previous(), ";|{|}|=|(|,|%cop% %varid% .", varid)) {
} else if (Token::Match(tok->previous(), ";|{|}|=|(|,|%cop% %varid% .|[", varid)) {
// warning is written for "dealloc ; use_ ;".
// but this use doesn't affect the leak-checking
addtoken(&rettail, tok, "use_");