fixed #3649 (False Positive: Uninitialized variable using operator assignment)
This commit is contained in:
parent
e0c880133c
commit
680883a6a7
|
@ -4360,7 +4360,7 @@ void Tokenizer::simplifyCompoundAssignment()
|
|||
break;
|
||||
}
|
||||
|
||||
someOperator |= (tok2->isOp() || (tok2->str() == "?"));
|
||||
someOperator |= (tok2->isOp() || (tok2->str() == "?") || tok2->isAssignmentOp());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6103,6 +6103,9 @@ private:
|
|||
ASSERT_EQUALS("; a = a + ( b && c ) ;", tokenizeAndStringify("; a+=b&&c;"));
|
||||
ASSERT_EQUALS("; a = a * ( b || c ) ;", tokenizeAndStringify("; a*=b||c;"));
|
||||
ASSERT_EQUALS("; a = a | ( b == c ) ;", tokenizeAndStringify("; a|=b==c;"));
|
||||
|
||||
// #3469
|
||||
ASSERT_EQUALS("; a = a + ( b = 1 ) ;", tokenizeAndStringify("; a += b = 1;"));
|
||||
}
|
||||
|
||||
void simplifyAssignmentInFunctionCall() {
|
||||
|
|
Loading…
Reference in New Issue