Skip to content

Commit 277185a

Browse files
authored
Merge pull request #3925 from geoffw0/rangefixup
C++: Add getFullyConverted() where missing in SimpleRangeAnalysis
2 parents e167b87 + 61dfebc commit 277185a

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)