Skip to content

Commit 61dfebc

Browse files
committed
C++: Add getFullyConverted() as suggested.
1 parent fe0c5a9 commit 61dfebc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ private float getLowerBoundsImpl(Expr expr) {
724724
exists(RShiftExpr rsExpr, float left, int right |
725725
rsExpr = expr and
726726
left = getFullyConvertedLowerBounds(rsExpr.getLeftOperand()) and
727-
right = rsExpr.getRightOperand().getValue().toInt() and
727+
right = rsExpr.getRightOperand().getFullyConverted().getValue().toInt() and
728728
result = safeFloor(left / 2.pow(right))
729729
)
730730
}
@@ -893,7 +893,7 @@ private float getUpperBoundsImpl(Expr expr) {
893893
exists(RShiftExpr rsExpr, float left, int right |
894894
rsExpr = expr and
895895
left = getFullyConvertedUpperBounds(rsExpr.getLeftOperand()) and
896-
right = rsExpr.getRightOperand().getValue().toInt() and
896+
right = rsExpr.getRightOperand().getFullyConverted().getValue().toInt() and
897897
result = safeFloor(left / 2.pow(right))
898898
)
899899
}

0 commit comments

Comments
 (0)