CheckIO: Early return
This commit is contained in:
parent
8f6bd7fd0d
commit
bc8f1b972e
|
@ -1361,9 +1361,12 @@ CheckIO::ArgumentInfo::ArgumentInfo(const Token * tok, const Settings *settings,
|
||||||
, address(false)
|
, address(false)
|
||||||
, isCPP(_isCPP)
|
, isCPP(_isCPP)
|
||||||
{
|
{
|
||||||
|
if (!tok)
|
||||||
|
return;
|
||||||
|
|
||||||
// Use AST type info
|
// Use AST type info
|
||||||
// TODO: This is a bailout so that old code is used in simple cases. Remove the old code and always use the AST type.
|
// TODO: This is a bailout so that old code is used in simple cases. Remove the old code and always use the AST type.
|
||||||
if (tok && !Token::Match(tok, "&| %str%|%num%|%name% ,|)") && !Token::Match(tok, "%name% [|(|.|<|::|?")) {
|
if (!Token::Match(tok, "&| %str%|%num%|%name% ,|)") && !Token::Match(tok, "%name% [|(|.|<|::|?")) {
|
||||||
const ValueType *valuetype = tok->argumentType();
|
const ValueType *valuetype = tok->argumentType();
|
||||||
if (valuetype && valuetype->type >= ValueType::Type::BOOL && !valuetype->pointer) {
|
if (valuetype && valuetype->type >= ValueType::Type::BOOL && !valuetype->pointer) {
|
||||||
tempToken = new Token(0);
|
tempToken = new Token(0);
|
||||||
|
@ -1388,7 +1391,7 @@ CheckIO::ArgumentInfo::ArgumentInfo(const Token * tok, const Settings *settings,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tok) {
|
|
||||||
if (tok->tokType() == Token::eString) {
|
if (tok->tokType() == Token::eString) {
|
||||||
typeToken = tok;
|
typeToken = tok;
|
||||||
return;
|
return;
|
||||||
|
@ -1514,7 +1517,6 @@ CheckIO::ArgumentInfo::ArgumentInfo(const Token * tok, const Settings *settings,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CheckIO::ArgumentInfo::~ArgumentInfo()
|
CheckIO::ArgumentInfo::~ArgumentInfo()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue