Skip to content

Commit 2c613a7

Browse files
committed
C++: Autoformat
1 parent a25cc2d commit 2c613a7

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

cpp/ql/src/semmle/code/cpp/rangeanalysis/RangeAnalysisUtils.qll

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,16 +352,11 @@ private predicate typeBounds(ArithmeticType t, float lb, float ub) {
352352
}
353353

354354
private Type stripReference(Type t) {
355-
if t instanceof ReferenceType then
356-
result = t.(ReferenceType).getBaseType()
357-
else
358-
result = t
355+
if t instanceof ReferenceType then result = t.(ReferenceType).getBaseType() else result = t
359356
}
360357

361358
/** Gets the type used by range analysis for the given `StackVariable`. */
362-
Type getVariableRangeType(StackVariable v) {
363-
result = stripReference(v.getUnspecifiedType())
364-
}
359+
Type getVariableRangeType(StackVariable v) { result = stripReference(v.getUnspecifiedType()) }
365360

366361
/**
367362
* Gets the lower bound for the unspecified type `t`.

cpp/ql/src/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,8 @@ bindingset[guard, v, branch]
13931393
predicate nonNanGuardedVariable(ComparisonOperation guard, VariableAccess v, boolean branch) {
13941394
getVariableRangeType(v.getTarget()) instanceof IntegralType
13951395
or
1396-
getVariableRangeType(v.getTarget()) instanceof FloatingPointType and v instanceof NonNanVariableAccess
1396+
getVariableRangeType(v.getTarget()) instanceof FloatingPointType and
1397+
v instanceof NonNanVariableAccess
13971398
or
13981399
// The reason the following case is here is to ensure that when we say
13991400
// `if (x > 5) { ...then... } else { ...else... }`

0 commit comments

Comments
 (0)