C++: Autoformat

This commit is contained in:
Jonas Jensen
2020-08-28 14:56:19 +02:00
parent a25cc2d9c7
commit 2c613a72b9
2 changed files with 4 additions and 8 deletions

View File

@@ -352,16 +352,11 @@ private predicate typeBounds(ArithmeticType t, float lb, float ub) {
}
private Type stripReference(Type t) {
if t instanceof ReferenceType then
result = t.(ReferenceType).getBaseType()
else
result = t
if t instanceof ReferenceType then result = t.(ReferenceType).getBaseType() else result = t
}
/** Gets the type used by range analysis for the given `StackVariable`. */
Type getVariableRangeType(StackVariable v) {
result = stripReference(v.getUnspecifiedType())
}
Type getVariableRangeType(StackVariable v) { result = stripReference(v.getUnspecifiedType()) }
/**
* Gets the lower bound for the unspecified type `t`.

View File

@@ -1393,7 +1393,8 @@ bindingset[guard, v, branch]
predicate nonNanGuardedVariable(ComparisonOperation guard, VariableAccess v, boolean branch) {
getVariableRangeType(v.getTarget()) instanceof IntegralType
or
getVariableRangeType(v.getTarget()) instanceof FloatingPointType and v instanceof NonNanVariableAccess
getVariableRangeType(v.getTarget()) instanceof FloatingPointType and
v instanceof NonNanVariableAccess
or
// The reason the following case is here is to ensure that when we say
// `if (x > 5) { ...then... } else { ...else... }`