Skip to content

Commit 28be3b4

Browse files
committed
Replaces name-reference to the class with canonical predicate.
1 parent 5acd982 commit 28be3b4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

python/ql/src/Expressions/TruncatedDivision.ql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ where
2929
and not lval.(NumericValue).intValue() % rval.(NumericValue).intValue() = 0
3030
and not bin.getNode().getEnclosingModule().hasFromFuture("division")
3131
// Filter out results wrapped in `int(...)`
32-
and not exists(CallNode c, ClassValue cls |
33-
c.getAnArg() = bin
34-
and c.getFunction().pointsTo(cls)
35-
and cls.getName() = "int"
32+
and not exists(CallNode c |
33+
c = ClassValue::int_().getACall()
34+
and c.getAnArg() = bin
3635
)
3736
)
3837
select div, "Result of division may be truncated as its $@ and $@ arguments may both be integers.",

0 commit comments

Comments
 (0)