parent
9579b12be9
commit
a4f8c44432
|
@ -562,25 +562,25 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
|
|||
|
||||
|
||||
const Token * endToken = ftok->linkAt(1);
|
||||
if(!Token::Match(endToken, "> %var% {|( %var%"))
|
||||
if (!Token::Match(endToken, "> %var% {|( %var%"))
|
||||
continue;
|
||||
|
||||
bool arrayDelete = false;
|
||||
if(Token::findsimplematch(ftok->next(), "[ ]", endToken))
|
||||
if (Token::findsimplematch(ftok->next(), "[ ]", endToken))
|
||||
arrayDelete = true;
|
||||
|
||||
// Check deleter
|
||||
const Token * deleterToken = nullptr;
|
||||
const Token * endDeleterToken = nullptr;
|
||||
const Library::AllocFunc* af = nullptr;
|
||||
if(Token::Match(ftok, "unique_ptr < %type% ,")) {
|
||||
if (Token::Match(ftok, "unique_ptr < %type% ,")) {
|
||||
deleterToken = ftok->tokAt(4);
|
||||
endDeleterToken = endToken;
|
||||
} else if(Token::Match(endToken, "> %var% {|( %var% ,")) {
|
||||
} else if (Token::Match(endToken, "> %var% {|( %var% ,")) {
|
||||
deleterToken = endToken->tokAt(5);
|
||||
endDeleterToken = endToken->linkAt(2);
|
||||
}
|
||||
if(deleterToken) {
|
||||
if (deleterToken) {
|
||||
// Check if its a pointer to a function
|
||||
const Token * dtok = Token::findmatch(deleterToken, "& %name%", endDeleterToken);
|
||||
if (dtok) {
|
||||
|
|
|
@ -48,8 +48,7 @@ public:
|
|||
int type;
|
||||
AllocInfo(int type_ = 0, AllocStatus status_ = NOALLOC) : status(status_), type(type_) {}
|
||||
|
||||
bool managed() const
|
||||
{
|
||||
bool managed() const {
|
||||
return status < 0;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue