Skip to content

Commit 640f900

Browse files
committed
C++: Add missing getFullyConverted for unary +/-
1 parent 50559d5 commit 640f900

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,12 @@ predicate linearAccessImpl(Expr expr, VariableAccess v, float p, float q) {
201201
or
202202
// +(p*v+q) == p*v + q
203203
exists (UnaryPlusExpr unaryPlusExpr
204-
| linearAccess(unaryPlusExpr.getOperand(), v, p, q) and
204+
| linearAccess(unaryPlusExpr.getOperand().getFullyConverted(), v, p, q) and
205205
expr = unaryPlusExpr)
206206
or
207207
// -(a*v+b) == -a*v + (-b)
208208
exists (UnaryMinusExpr unaryMinusExpr, float a, float b
209-
| linearAccess(unaryMinusExpr.getOperand(), v, a, b) and
209+
| linearAccess(unaryMinusExpr.getOperand().getFullyConverted(), v, a, b) and
210210
expr = unaryMinusExpr and
211211
p = -a and
212212
q = -b)

0 commit comments

Comments
 (0)