fix comments

This commit is contained in:
Slavomir
2020-04-06 21:40:29 +03:00
parent 6d2c5be196
commit fd9e3a005e

View File

@@ -118,13 +118,13 @@ predicate comparisonGreaterOperandIsEqualOrLess(
) {
conv.getTypeName() = typeName and
(
// exclude cases like: if parsed < math.MaxInt8 { int8(parsed)}
// exclude cases like: if parsed < math.MaxInt8 {return int8(parsed)}
ifExpr.getComparison().getGreaterOperand().getNumericValue() = value and
// and lesser is the conversion operand:
ifExpr.getComparison().getLesserOperand().getGlobalValueNumber() =
conv.getOperand().getGlobalValueNumber()
or
// exclude cases like: if err == nil && parsed < math.MaxInt8 { int8(parsed)}
// exclude cases like: if err == nil && parsed < math.MaxInt8 {return int8(parsed)}
exists(RelationalComparisonExpr andExpr |
andExpr = ifExpr.getLandExpr().getAnOperand().(RelationalComparisonExpr)
|