Skip to content

Commit 438cc5f

Browse files
committed
fixup! C++: Apply widening based on number of bounds measure
1 parent 233ff08 commit 438cc5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,8 @@ private module BoundsEstimate {
755755
exists(RangeSsaDefinition def, StackVariable v |
756756
e = def.getAUse(v) and
757757
result = nrOfBoundsDef(def, v) and
758-
not exists(getValue(e).toFloat()) // Why?
758+
// Avoid returning two numbers when `e` is a use with a constant value.
759+
not exists(getValue(e).toFloat())
759760
)
760761
or
761762
e instanceof UnsignedBitwiseAndExpr and

0 commit comments

Comments
 (0)