Skip to content

Commit 7f63c1c

Browse files
committed
ValueFlow: avoid possibly unused assignments in combineValueProperties()
1 parent 57e7287 commit 7f63c1c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/valueflow.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,28 +395,28 @@ void ValueFlow::combineValueProperties(const ValueFlow::Value &value1, const Val
395395
result.tokvalue = value1.tokvalue;
396396
else if (value2.tokvalue)
397397
result.tokvalue = value2.tokvalue;
398-
if (value1.isSymbolicValue()) {
399-
result.valueType = value1.valueType;
400-
result.tokvalue = value1.tokvalue;
401-
}
402398
if (value2.isSymbolicValue()) {
403399
result.valueType = value2.valueType;
404400
result.tokvalue = value2.tokvalue;
405401
}
406-
if (value1.isIteratorValue())
402+
else if (value1.isSymbolicValue()) {
407403
result.valueType = value1.valueType;
404+
result.tokvalue = value1.tokvalue;
405+
}
408406
if (value2.isIteratorValue())
409407
result.valueType = value2.valueType;
408+
else if (value1.isIteratorValue())
409+
result.valueType = value1.valueType;
410410
result.condition = value1.condition ? value1.condition : value2.condition;
411411
result.varId = (value1.varId != 0) ? value1.varId : value2.varId;
412412
result.varvalue = (result.varId == value1.varId) ? value1.varvalue : value2.varvalue;
413413
result.errorPath = (value1.errorPath.empty() ? value2 : value1).errorPath;
414414
result.safe = value1.safe || value2.safe;
415415
if (value1.bound == ValueFlow::Value::Bound::Point || value2.bound == ValueFlow::Value::Bound::Point) {
416-
if (value1.bound == ValueFlow::Value::Bound::Upper || value2.bound == ValueFlow::Value::Bound::Upper)
417-
result.bound = ValueFlow::Value::Bound::Upper;
418416
if (value1.bound == ValueFlow::Value::Bound::Lower || value2.bound == ValueFlow::Value::Bound::Lower)
419417
result.bound = ValueFlow::Value::Bound::Lower;
418+
else if (value1.bound == ValueFlow::Value::Bound::Upper || value2.bound == ValueFlow::Value::Bound::Upper)
419+
result.bound = ValueFlow::Value::Bound::Upper;
420420
}
421421
if (value1.path != value2.path)
422422
result.path = -1;

0 commit comments

Comments
 (0)