Uninitialized variables: Cleanup '+=' handling. This is simplified in the Tokenizer now.
This commit is contained in:
parent
35c72db251
commit
eb54be2b2a
|
@ -537,26 +537,6 @@ private:
|
|||
return &tok;
|
||||
}
|
||||
|
||||
// += etc
|
||||
if (Token::Match(tok.previous(), "[;{}]") || Token::Match(tok.tokAt(-2), "[;{}] *"))
|
||||
{
|
||||
// goto the equal..
|
||||
const Token *eq = tok.next();
|
||||
if (eq && eq->str() == "[" && eq->link() && eq->link()->next())
|
||||
eq = eq->link()->next();
|
||||
|
||||
// is it X=
|
||||
if (Token::Match(eq, "+=|-=|*=|/=|&=|^=") || eq->str() == "|=")
|
||||
{
|
||||
if (tok.previous()->str() == "*")
|
||||
use_pointer(checks, &tok);
|
||||
else if (tok.next()->str() == "[")
|
||||
use_array(checks, &tok);
|
||||
else
|
||||
use(checks, &tok);
|
||||
}
|
||||
}
|
||||
|
||||
if (Token::Match(tok.next(), "= malloc|kmalloc") || Token::simpleMatch(tok.next(), "= new char ["))
|
||||
{
|
||||
alloc_pointer(checks, tok.varId());
|
||||
|
|
Loading…
Reference in New Issue