Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5acd982

Browse files
committed
Swaps ...obj for ...val
1 parent 91ea46f commit 5acd982

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

python/ql/src/Expressions/TruncatedDivision.ql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ where
1818
// Only relevant for Python 2, as all later versions implement true division
1919
major_version() = 2
2020
and
21-
exists(BinaryExprNode bin, Value lobj, Value robj |
21+
exists(BinaryExprNode bin, Value lval, Value rval |
2222
bin = div.getAFlowNode()
2323
and bin.getNode().getOp() instanceof Div
24-
and bin.getLeft().pointsTo(lobj, left)
25-
and lobj.getClass() = ClassValue::int_()
26-
and bin.getRight().pointsTo(robj, right)
27-
and robj.getClass() = ClassValue::int_()
24+
and bin.getLeft().pointsTo(lval, left)
25+
and lval.getClass() = ClassValue::int_()
26+
and bin.getRight().pointsTo(rval, right)
27+
and rval.getClass() = ClassValue::int_()
2828
// Ignore instances where integer division leaves no remainder
29-
and not lobj.(NumericValue).intValue() % robj.(NumericValue).intValue() = 0
29+
and not lval.(NumericValue).intValue() % rval.(NumericValue).intValue() = 0
3030
and not bin.getNode().getEnclosingModule().hasFromFuture("division")
3131
// Filter out results wrapped in `int(...)`
3232
and not exists(CallNode c, ClassValue cls |

0 commit comments

Comments
 (0)