Files
codeql/csharp/ql/test/library-tests/assignments/AssignOperationExpanded.ql
Anders Schack-Mulligen 726a873c3e C#: Autoformat.
2020-01-29 13:15:00 +01:00

23 lines
549 B
Plaintext

import csharp
predicate getExpandedOperatorArgs(Expr e, Expr left, Expr right) {
e =
any(BinaryArithmeticOperation bo |
bo.getLeftOperand() = left and
bo.getRightOperand() = right
)
or
e =
any(OperatorCall oc |
oc.getArgument(0) = left and
oc.getArgument(1) = right
)
}
from AssignOperation ao, AssignExpr ae, Expr op, Expr left, Expr right
where
ae = ao.getExpandedAssignment() and
op = ae.getRValue() and
getExpandedOperatorArgs(op, left, right)
select ao, ae, ae.getLValue(), op, left, right