Update isLikelyStreamRead (#8494)
This commit is contained in:
parent
7825eb8670
commit
219176c11c
|
@ -631,20 +631,16 @@ bool isLikelyStreamRead(bool cpp, const Token *op)
|
|||
if (!cpp)
|
||||
return false;
|
||||
|
||||
if (Token::Match(op, ">> %name% >>|;")) {
|
||||
const Token *parent = op;
|
||||
while (Token::simpleMatch(parent->astParent(), ">>"))
|
||||
parent = parent->astParent();
|
||||
if (parent->astParent())
|
||||
return false;
|
||||
if (!parent->astOperand1() || !parent->astOperand2())
|
||||
return false;
|
||||
return (!parent->astOperand1()->valueType() || !parent->astOperand1()->valueType()->isIntegral());
|
||||
}
|
||||
if (!Token::Match(op, "& %name% ;|&") && !Token::Match(op, ">> %name% ;|>>"))
|
||||
return false;
|
||||
|
||||
if (Token::Match(op, "& %name% ;") && !op->astParent() && op->astOperand1() && op->astOperand2() && (!op->astOperand1()->valueType() || !op->astOperand1()->valueType()->isIntegral()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
const Token *parent = op;
|
||||
while (parent->astParent() && parent->astParent()->str() == op->str())
|
||||
parent = parent->astParent();
|
||||
if (parent->astParent())
|
||||
return false;
|
||||
if (!parent->astOperand1() || !parent->astOperand2())
|
||||
return false;
|
||||
return (!parent->astOperand1()->valueType() || !parent->astOperand1()->valueType()->isIntegral());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue