@@ -442,14 +442,15 @@ namespace ValueFlow
442
442
}
443
443
444
444
// Offset of non null pointer is not null also
445
- else if (astIsPointer (tok) && Token::Match (parent, " +|-" ) && value.isIntValue () && value.isImpossible () && value.intvalue == 0 ) {
445
+ else if (astIsPointer (tok) && Token::Match (parent, " +|-" ) && value.isIntValue () && value.isImpossible () &&
446
+ value.intvalue == 0 ) {
446
447
setTokenValue (parent, value, settings);
447
448
}
448
449
449
450
// Calculations..
450
- else if ((parent->isArithmeticalOp () || parent->isComparisonOp () || (parent->tokType () == Token::eBitOp) || (parent-> tokType () == Token::eLogicalOp)) &&
451
- parent->astOperand1 ( ) &&
452
- parent->astOperand2 ()) {
451
+ else if ((parent->isArithmeticalOp () || parent->isComparisonOp () || (parent->tokType () == Token::eBitOp) ||
452
+ ( parent->tokType () == Token::eLogicalOp) ) &&
453
+ parent->astOperand1 () && parent-> astOperand2 ()) {
453
454
454
455
const bool noninvertible = isNonInvertibleOperation (parent);
455
456
@@ -664,7 +665,8 @@ namespace ValueFlow
664
665
}
665
666
666
667
// C++ init
667
- else if (parent->str () == " {" && Token::simpleMatch (parent->previous (), " = {" ) && Token::simpleMatch (parent->link (), " } ;" )) {
668
+ else if (parent->str () == " {" && Token::simpleMatch (parent->previous (), " = {" ) &&
669
+ Token::simpleMatch (parent->link (), " } ;" )) {
668
670
const Token* lhs = parent->previous ()->astOperand1 ();
669
671
if (lhs && lhs->valueType ()) {
670
672
if (lhs->valueType ()->isIntegral () || lhs->valueType ()->isFloat () || (lhs->valueType ()->pointer > 0 && value.isIntValue ())) {
0 commit comments